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

Undefined is not an object(evaluating) - angular
Font Awesome with Ionic2
angular view is not updating after component value gets changed
how do I merge the values of the child components of angular2 into reactive form object?
Angular2 multiple components different imports
Update an array with new objects
Dropbox service with popup
Sending Emails Using TinyMce- Angular 2
Nested form tags in angular 2
Toggle Value in Angular Material CheckBox
Angular2 cli error cannot resolve #angular animations from primeng2 components
ionic2 AlertController, how to return the buttons clicked value from method
Cannot read property 'stateChangeExpr' of null at _parseAnimationStateTransition
Angular2 : not able to install xml2json
Ionic 3 - Supplied parameters do not match any signature of call target
Angular2/Rxjs HTTP Catch Asynchronous Transform Issue

Categories

HOME
docker
parsing
qt5
phpunit
momentjs
instagram
kotlin
sendmail
webserver
visual-foxpro
jaxb
apache-apex
directshow
shoutem
snapshot
logstash-grok
video-processing
shogun
tablesorter
jxmaps
spring-data-elasticsearch
derivative
cloudify
ajaxform
intercept
google-cloud-vision
ext4
pgadmin
master-detail
android-ffmpeg
multiple-domains
live
pam
regex-negation
magnolia
handbrake
tornado-motor
responsive-filemanager
winrt-xaml
pi
youtube-analytics
r6
sap-bw
tycho
ios6
yield
data-processing
angular-chart
bandwidth
fluentbootstrap
allegro5
wamp-protocol
jsdoc3
bisonc++
dispy
on-screen-keyboard
istanbul
libtool
embedded-javascript
c#-to-vb.net
gyp
google-chrome-arc
ch
imshow
kindle
ienumerable
grid-layout
google-roads-api
yahoo-messenger
ionic-view
pragma
jedit
tess-two
html5builder
acl2
eofexception
aloha-editor
fswatch
mpmediapickercontroller
html5-template
google-text-to-speech
resin
iec61131-3
bonjour
avassetwriter
pivotitem
mic-1
amber-smalltalk
.class-file
pull-to-refresh
java-service-wrapper
sequence-alignment
django-sessions
visual-assist-x
utl-file
html-validation
python-sockets
wymeditor
plcrashreporter
google-ad-manager
openflashchart2
paint.net
projective-geometry
orbited
sqlmetal

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile