Board index » delphi » Can't get POST to work in HTTP client

Can't get POST to work in HTTP client

Hi,
I need help with this.
Can't get POST to work in the HTTP client.
I have used the ICS HTTP client with no problems now I need to use the indy
client (need SSL support) and I can't get it to work.
I'm using the demo app to test it and I get a response if I put the post
request in the url but not if I have it separated.
Here's an example :
URL : http://hostname/urlpath/servlet?
postdata : id=196&getTask=getTask
This won't return anything but if I set the
URL to http://hostname/urlpath/servlet?id=196&getTask=getTask
I get a response.

/Leif

 

Re:Can't get POST to work in HTTP client


Don't forget to set Content-type to "application/x-www-form-urlencoded"
You have to tell the server what kind of date you are going to post.

Doychin
doic...@5group.com

Quote
"Leif Lundberg" <leif.lundb...@privat.utfors.se> wrote in message

news:3a7e66b0$1_2@dnews...
Quote
> Hi,
> I need help with this.
> Can't get POST to work in the HTTP client.
> I have used the ICS HTTP client with no problems now I need to use the
indy
> client (need SSL support) and I can't get it to work.
> I'm using the demo app to test it and I get a response if I put the post
> request in the url but not if I have it separated.
> Here's an example :
> URL : http://hostname/urlpath/servlet?
> postdata : id=196&getTask=getTask
> This won't return anything but if I set the
> URL to http://hostname/urlpath/servlet?id=196&getTask=getTask
> I get a response.

> /Leif

Re:Can't get POST to work in HTTP client


Thanks for replying.
Content-type is set to "application/x-www-form-urlencoded",  response buffer
still empty..
I think I have copyed all settings from the ICS client to the indy client
that I need, but something is missing...

/Leif

Doychin Bondzhev skrev i meddelandet <3a7e6828_2@dnews>...

Quote
>Don't forget to set Content-type to "application/x-www-form-urlencoded"
>You have to tell the server what kind of date you are going to post.

>Doychin
>doic...@5group.com

Re:Can't get POST to work in HTTP client


I found the problem, it was the content type, I set it in the HTTP client
and missed that the demo set it in the "go" method :(

/Leif

Other Threads