Re: [twsocket] TSslHTTPCli: POST with XML data to get RESOURCE on REST

2012-01-29 Thread RTT

On 29-01-2012 16:19, François Piette wrote:

Please provide the link to the API you are trying to implement. Just that
part is not enough.

https://content.etrade.com/etrade/estation/pdf/API_Technical_Documentation.pdf
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] TSslHTTPCli: POST with XML data to get RESOURCE on REST

2012-01-29 Thread RTT

On 29-01-2012 16:00, Iqbal Husain wrote:

3.   Getting Account List. {REST resource HTTP Method GET}

4.   Getting Account Balance. {REST resource HTTP Method GET}



In all of my above example, I put the OAuth parameters in
TSslHTTPCli.SendStream and it works fine.


How's that possible?! The GET method don't use the sendstream. With that 
methods you can only send the parameters in the URL itself, or in the 
request header.


Take a look to this source code
http://eden.fm/2011/02/27/twitter-library-for-delphi/
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] TSslHTTPCli: POST with XML data to get RESOURCE on REST

2012-01-29 Thread François Piette
>HERE IS A LINK FOR API 
>SCREENSHOT FOR THE POST METHOD

Please provide the link to the API you are trying to implement. Just that
part is not enough.

Have you seen this : http://tools.ietf.org/html/draft-ietf-oauth-v2-23 and
this : http://tools.ietf.org/html/rfc5849 ?
Which part of the standard is the problem ?

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be




-Message d'origine-
De : twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] De la
part de Iqbal Husain
Envoyé : dimanche 29 janvier 2012 17:00
À : ICS Overbyte Mailing List
Objet : [twsocket] TSslHTTPCli: POST with XML data to get RESOURCE on REST

Hi,

I am working on an OAuth API. I achieved the following using TSslHTTPCli in
combination with TSslContext:

1.   Getting Token and Secret Token.

2.   Getting Access Token and Access Secret Token.

3.   Getting Account List. {REST resource HTTP Method GET}

4.   Getting Account Balance. {REST resource HTTP Method GET}

 

In all of my above example, I put the OAuth parameters in
TSslHTTPCli.SendStream and it works fine.

 

What I am not able to do is to get REST resource with HTTP Method POST. The
documentation in the API is:

 

HERE IS A LINK FOR API 
SCREENSHOT FOR THE POST METHOD

 

 

The problem is:

I have OAuth parameters to pass the given URL with the above parameters. I
am not sure how to this. What I tried:

1.   I put the OAuth parameters in the URL and put the XML (with related
values in an ANSIString) in TSslHTTPCli.SendStream

 

The Response was "ERORR: 400"

 

2.   I put OAuth parameters in TSslHTTP.SendStrean and added the XML
string to Head in OnBeforeHeader event.

 

The Response was "ERROR: 400"

 

3.   I added these value as a field = value format and added to URL also
put in TSslHTTPCli.SendStream 

 

The Response was "415 Unsupported Media"

 

 

ANY HELP WILL BE MUCH APPRICIATED.

 

Thanks

Iqbla Husain

 

 

 

 

 

--
To unsubscribe or change your settings for TWSocket mailing list please goto
http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be