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

Is Angular2 responsive out of the box?
Async call update HTML Element though Angular 4.x Service
Uncaught ReferenceError: define is not defined angular2/webpack 1
unable to find suitable angular data grid for angular 2.4.1 version?
Access process.env in environment.ts file created from the angular-cli
Cannot read property 'channels' of undefined youtube api
How to set the public path on angular 4
Using local Bootstrap3 with angular 2
Firebase: update database when no write operation happens in 5 minutes interval
Build single directive to perform both Structural & Attribute behaviour?
Angular 2 Sending data to child
AOT - Function calls are not supported Module.forRoot
subscribe to ionic page change event
Dynamic number of Promise in Angularfire2
Drag and drop doesn't call change event in ie/edge angular2
Angular2 routing issue and ngOnInit called twice

Categories

HOME
google-maps
scadalts
data-warehouse
jupyter-notebook
mariadb
put
sage
rpres
rectangles
crc32
apostrophe-cms
shoutem
strongloop
interaction
category
video.js
atlassian-sourcetree
recurly
xlwings
sitefinity
gnome
postmates
cut
eof
oracle-data-integrator
hibernate-criteria
pgadmin
maxlength
mahapps.metro
pam
webdrivermanager-java
ngrx-effects
data-storage
pivottable.js
actor
automated-deployment
keyword-search
simplemodal
ole
pwd
wistia
proof-of-correctness
strconv
graylog
date-formatting
leap-motion
nsoutlineview
azure-webjobssdk
ms-project-server-2013
decompression
code-collaborator
correspondence-analysis
nested-forms
xlconnect
numerical-analysis
ratchet
grape
yahoo-messenger
arrangeoverride
togglz
lg
distinct-on
ti-nspire
elmah.mvc
unique-constraint
bpopup
proto
ekeventstore
childviewcontroller
openni
jxa
grunt-contrib-cssmin
rgs
cleartool
chap-links-library
mysql-error-1093
workbench
raii
mongodb-indexes
google-playground
telerik-test-studio
policies
commission-junction
angularjs-e2e
circular-reference
rdata
amber-smalltalk
django-staticfiles
dotfuscator
hyperterminal
mysql-error-1052
memory-mapped-files
nsinteger
getprocaddress
osx-gatekeeper
twisted.internet
webarchive
continuations
windows-networking
test-environments
fql.multiquery
multiple-versions
cck
showmodaldialog
blogml
ipod-nano
maintenance-plan
reverse-debugging

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App