bsky
bsky

Reputation: 20222

Pass username and password together with HTTP request

In my Jenkins build I am using httpRequest like this:

httpRequest http://my-server.com

I would like to add username and password authentication as well, something like:

httpRequest http://my-server.com --username=myUsername --password=myPassword

I didn't find any information about this on the documentation. Any idea how this could be done?

Upvotes: 1

Views: 5219

Answers (2)

Pablo Miranda
Pablo Miranda

Reputation: 369

Send the URL like this:

http://username:password@your-jenkins-server:port/

Just tested it and it worked fine.

Upvotes: 1

paqash
paqash

Reputation: 2314

Have you tried: http://myUsername:[email protected] ?

This is the usual way to send authentication data via HTTP

Upvotes: 4

Related Questions