HTTPS POST with basic authentication

P

Piyush Ranjan

[Note: parts of this message were removed to make it a legal post.]

Hi
I need to do a https POST with basic authentication to query a service. I am
unable to find this in api or any of the blog entries I am seen so far. Is
it possible to do this ?
 
B

Bill Kelly

From: "Piyush Ranjan said:
I need to do a https POST with basic authentication to query a service. I am
unable to find this in api or any of the blog entries I am seen so far. Is
it possible to do this ?


require 'base64' # NOTE: the name of this module may be different

headers = {}
headers['Authorization'] = 'Basic ' + encode64("#{user}:#{pass}").chop
resp = http.post(path, body, headers)


Hope this helps,

Bill
 
P

Piyush Ranjan

[Note: parts of this message were removed to make it a legal post.]

thanks bill
this is exactly what I implemented

Piyush

From: "Piyush Ranjan said:
I need to do a https POST with basic authentication to query a service. I
am
unable to find this in api or any of the blog entries I am seen so far. Is
it possible to do this ?


require 'base64' # NOTE: the name of this module may be different

headers = {}
headers['Authorization'] = 'Basic ' + encode64("#{user}:#{pass}").chop
resp = http.post(path, body, headers)


Hope this helps,

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top