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

VelocityJS in a TypeScript project throws '../node_modules/#types/velocity-animate/index.d.ts is not a module'
How to resubscribe to an observable?
Angular material 2 dynamic button toggle group form control accessor
Debug Tests in NG Test
Angular 2. Doubled custom tags
Integration Stripe Elements with angular 2
How to format phone number while typing in angular 2?
Angular: Wrap providers in a module?
Angular - getting the handle to the ng-content component in the parent
How to use ng.material.MdDialog in ES5?
Access to a variable through all the components Angular2
Trouble with Microsoft Edge, Protractor and Jasmine
Error: XHR error (404 Not Found) in Angular2 application
do I have to create custom value accessors to use buttons as form controls in angular 2?
Angular 2 datatable with keyboard support
Karma can't find my tests in my angular-cli app

Categories

HOME
arduino
recaptcha
sendmail
wildfly
zurb-foundation
windows-installer
etcd
q-learning
google-places-api
outlook-addin
external
directshow
flannel
video-processing
kafka-consumer-api
border
sdl
spring-boot-actuator
accurev
beatbox
nlog
zillow
robots.txt
probability-theory
mdm
ssis-2008
robotium-recorder
edi
hibernate-criteria
filenames
z80
bing-api
lwip
coupon
radius
drools-fusion
nexmo
android-adapter
opensaml
swiftmailer
dexguard
azure-virtual-machine
ngrx-effects
outlook-web-app
card-flip
data-compression
smartassembly
oracle-ebs
webos
jenkinsfile
yield
release-management
icingaweb2
zoo
on-screen-keyboard
magicalrecord
cscope
volume-rendering
helium
throttle
amazon-mobile-analytics
servant
cts
mime-mail
bitcount
xmlpullparser
typescript1.7
compiler-options
wpftoolkit
mysql-num-rows
slab
virtual-address-space
apache-tomee
member
option
apparmor
raii
opendocument
maptiler
iron
problem-steps-recorder
dbase
tiles2
statamic
facebook-events
mercurial-subrepos
32feet
texinfo
assetslibrary
raw-ethernet
xmlnodelist
cck
sqlmetal
astoria

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile