REST call using IdHTTP.GET not working

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

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