angular


Angular 2: post job on jenkins


I am trying to "covert" this curl command into angular HTTP post, and I cannot figure how to send the --user
this command is used to start new job in jenkins:
curl -X POST 'http://10.1.11.160:8080/job/Job1/buildWithParameters?GW_IP=10.1.11.51&verbosity=aaa' --user angular:angular
I tried many things - I am unable to add additional header
I am using basic http from '#angular/http
this is my code without adding the header
runTest(){
var Url = "http://10.1.11.160:8080/job/";
var JobName = "job1" + "/";
var Parameters = 'GW_IP=10.1.11.51&verbosity=high';
var Action = "buildWithParameters?";
var Job = Url + JobName + Action + Parameters ;
var Body = '';
return this._http.post(Job, Body)
.map(res => res.json());
}
this is what I am trying to accomplish:
If I'm reading the documentation correctly, you can still set headers using a config object as the third argument.
return this._http.post(Job, Body, {headers:{'Authorization': 'whatcurlshowedyou'}})
.map(res => res.json());
You might also want to follow the style guide and name your locals using camelCase for readability.

Related Links

when i run npm i got this error. how to fix this?
Angular2 add nativeElement to component's prototype
Property 'value' does not exist on type 'ElementRef'
Getting all routes from current module - Angular 2
Ionic 2 Cache issue with tabs application
Set selected option by default on angular template
Downloading Redux State into an Angular 2 component and then iterating over its result
How to push on FormArray without FormBuilder on Angular 2
Angular 2, Uncaught Type Error: Cannot read property 'Injectable' of undefined
Set width to an Angular2-modal window
identityserver4 angular client, from where come the call to this endpoint
Angular2 translation after subscribing to service
Kendo UI - Texfield not showing in MultiSelect when Value is 0
InvalidPipeArgument for pipe 'DatePipe'
Native Element in angular 2
Module Communication between Product Module and User Module

Categories

HOME
react-native
web
openerp
knn
informix
text
custom-attributes
asp.net-web-api2
bluetooth-lowenergy
uinavigationcontroller
worksheet-function
jasperserver
dynamics-ax-2012
mupdf
pad
odbc
derivative
moshi
boto
jqxwidgets
phylogeny
structured-data
messagebox
webcam
filenames
spacing
omnipay
sqlcedatareader
podcast
live
pam
regex-negation
google-tv
ngrx-effects
ansible-vault
interstitial
ssas-tabular
google-truth
carplay
webpack-style-loader
oltp
sift
autocompleteextender
on-screen-keyboard
schemaless
simplehttpserver
r.js
jquery-tags-input
google-api-v3
spring-social-facebook
code-signing-entitlements
android-runtime
report-viewer2012
twebbrowser
python-wheel
reportviewer2008
classname
nibble
reducers
ntfs-3g
arrangeoverride
tvml
pragma
pdf-extraction
divider
realbasic
jedit
gridsplitter
angular-ui-tree
bullseye
sql-agent-job
jaxb2-maven-plugin
kermit
savefiledialog
childviewcontroller
rot13
mooc
resharper-plugins
code-metrics
raii
google-playground
usermode
freetextbox
parallel.for
mat-file
emacs-semantic
rdata
mib
outlook-2003
server-side-scripting
jwebunit
java-service-wrapper
lytebox
static-array
appmobi
jlayer
python-sockets
mono-service
looper
trx
libjson
pointer-arithmetic
remote-administration

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile