Re: REST call using IdHTTP.GET not working

Giganews Newsgroups
Subject: Re: REST call using IdHTTP.GET not working
Posted by:  Gerry (gpettip…@mmspos.com)
Date: Wed, 23 Feb 2011

Wow! I got this to work!

Instead of making my identity token part of the URL, I added it to the
IdHTTP object like this:

IdHTTP.Request.Username := sIdentToken;

"Gerry" <gpettip…@mmspos.com> wrote in message
news:900AB19FB5D2E340gpettip…@mmspos.com...
> Hi,
>
> I'm using Delphi 2007 and Indy 9.0.50 and I'm making a REST call.
>
> I have a URL for a commerce site. I need to be able to do a GET in order
> to get back a session token. I'm using IdHTTP and IdSSLIOHandlerSocket.
>
> The call looks like this:
>
> Memo1.Lines.Text := IdHTTP.GET('https://<commerce site
> url>/token?username=<my assigned identity token');
>
> I get an "HTTP/1.1 401 Unauthorized" response.
>
> If I take exactly what gets used in the GET and I put it into my FireFox
> address bar, I get a session token back.
>
> I'm obviously missing something; I'm just not sure what it is.
>
> Gerry

Replies

None

In response to

REST call using IdHTTP.GET not working posted by Gerry on Wed, 23 Feb 2011