login about faq

I am being asked to send this sample request using HTTPS abd and receive a response

https://www.sample.com/Authenticate?username=tuser@test.com&password=123456

I'm doing this to try to accomplish this (following your example codes as best I could)

 HttpsClient.Accept := 'application/json' ;    
 endpointDomain := 'www.sample.com';
 endpointPort := 443 ;
 endpointSsl := 1;

 request := TChilkatHttpRequest.Create(Self);
 request.Path := '/Authenticate?username=tuser%40test.com&password=123456' ;
 request.HttpVerb := 'GET';

 Memo.Lines.Add('SENDING REQUEST') ;
 response :=         HttpsClient.SynchronousRequest(endpointDomain,endpointPort,endpointSsl,request.DefaultInterface);

It doesn't seem to be working so I'm wondering if my request.path is actually how to handle this request.

Thanks for your info! jeff

asked Nov 27 '13 at 03:21

Jeff%20Newlin's gravatar image

Jeff Newlin
1112


A GET request is an HTTP request where the params are provided in the query part of the URL -- which is the part that follows the "?" and is composed of name=value pairs, concatenated with "&".

The path part of the URL is that part prior to the "?", excluding the domain and port.

The request.Path property should be set to the path part of the URL. In this case, it would be "/Authenticate".

The params should be added by calling request.AddParam(name,value), once per param.

If the request.HttpVerb is set to "GET", then the request will be formatted as a GET request where the params are part of the URL (in the query part of the URL). If the request.HttpVerb is "POST", then the params are in the body of the HTTP request (i.e. the MIME body) and the encoding, by default is application/x-www-form-urlencoded. What this means is that the params are passed in the MIME body of the request in the exact same format as they would occur in the URL. The only difference is where they are located in the request. The GET is limited in how much data can be provided in the params because of URL length limitations.

link

answered Dec 16 '13 at 10:50

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×13

Asked: Nov 27 '13 at 03:21

Seen: 935 times

Last updated: Dec 16 '13 at 10:50

powered by OSQA