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

Angular 2 xi18n cannot resolve template path outside of component directory
Angular 2 - Uncaught (in promise): ReferenceError: System is not defined
update routes dynamically in angular2 app
Resolving Multiple Pieces of Data using Resolve Guard in Angular 2
Angular 2 disable form button from ts?
ng2-charts - Can't bind to 'datasets' since it isn't a known property of 'base-chart'
Angular 2 not showing correctly values in input
Webpack resolve.modulesDirectories doesn't seem to work
Text editors in angular2
Where can i find the latest ionic-angular2 version in a plunker that uses #Ngmodule?
How to manually lazy load a module?
Angular2 Prevent route change if any changes made in the view
Angular2 pass data from component to root component, without child component
Angular 2 $this.parent().next().show() on click
Having difficulty setting up Asp.net(Framework) project with typescript
ngModel not showing data when using promises

Categories

HOME
angular
loadrunner
netlogo
luigi
g2o
node-red
maven-lifecycle
windows-installer
caffe
dropzone.js
ais
instagram-api
google-cloud-endpoints
external
virtocommerce
android-animation
geoserver
quandl
purescript
google-vr
pthreads
snapshot
httpresponse
axon
adodb-php
filenet-p8
cassandra-cli
atlassian-sourcetree
recurly
.net-4.5
nlog
polymer-1.0
file-permissions
wikitude
boost-python
phylogeny
eof
ractivejs
formsets
webcam
u2
interceptor
geckofx
affiliate
jqassistant
c#-to-f#
infowindow
sublimerepl
aircrack-ng
android-adapter
regex-negation
gsutil
flops
initializing
card-flip
cachemanager
dreamhost
protactor
o365rwsclient
lpc
cakephp-3.3
measurement-studio
javac
wamp-protocol
ikvm
jquery-ui-tabs
doubly-linked-list
bubble-sort
data-transfer
nslog
express-stormpath
stdio
htsql
kindle
plone-4.x
compass
owner
markov-models
rouge
sos
heapsort
jedit
build-dependencies
avm2
angularjs-ng-options
excel-2008
ms-query
utilities
uiactivity
c1flexgrid
wunderlist
openni
cakedc
grunt-contrib-cssmin
android-view
comfortable-mexican-sofa
lcm
accessdatasource
ios-provisioning
complete.ly
yepnope
stencils
android-3.0-honeycomb
harfbuzz
boost-spirit-karma
perl-critic
outlook-2003
jwebunit
iwebkit
pmp
emacs-dirtree
c89
launching-application
wymeditor
raw-ethernet
eda
xcode4.1
equivalent
trx
httpverbs
language-theory
loose-coupling
tibco-gi

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