Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > HTTPS POST with basic authentication

Reply
Thread Tools

HTTPS POST with basic authentication

 
 
Piyush Ranjan
Guest
Posts: n/a
 
      09-12-2008
[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 ?

 
Reply With Quote
 
 
 
 
btricha@gmail.com
Guest
Posts: n/a
 
      09-12-2008
Have you tried including your username and password in the url when
you create your uri for the POST request?

For example, http://foo:(E-Mail Removed), where foo is your username
and bar is your password.

On 9/12/08, Piyush Ranjan <(E-Mail Removed)> wrote:
> 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 ?
>


 
Reply With Quote
 
 
 
 
Bill Kelly
Guest
Posts: n/a
 
      09-12-2008

From: "Piyush Ranjan" <(E-Mail Removed)>
>
> 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



 
Reply With Quote
 
Piyush Ranjan
Guest
Posts: n/a
 
      09-12-2008
[Note: parts of this message were removed to make it a legal post.]

thanks bill
this is exactly what I implemented

Piyush

On Sat, Sep 13, 2008 at 1:47 AM, Bill Kelly <(E-Mail Removed)> wrote:

>
> From: "Piyush Ranjan" <(E-Mail Removed)>
>
>>
>> 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
>
>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
server side redirect https => https NOT working Axel ASP General 8 04-27-2009 02:02 AM
https authentication & storing https page in string Naveen Dhanuka Ruby 1 09-19-2007 02:05 PM
open-uri and HTTPS, or net/https with a redirect jotto Ruby 4 10-02-2006 07:26 AM
Basic Authentication v. Integrated Windows Authentication w/ Delegation Mark ASP .Net 0 01-20-2004 03:13 PM
ASP.Net Forms authentication with basic authentication popup Brett Porter ASP .Net 2 01-20-2004 02:17 PM



Advertisments