NaN
NaN

Reputation: 9104

How to send big data from delphi to a remote php script and wait for answer?

I am in risk of being very criticized over this question, because it might have been answered here, but I do not know to look right for it. I tried to get an answer in Foruns, but people bother to show up and say "I don't know".

I usually use TIdHTTP to call a remote PHP script and receive some data, but only when I need to communicate with REST server inputting the data directly as a parameter.

Now I need to send some big JSON object (encoded and much more than 255 bytes) and I do not know how to do it in Delphi. I know that it should be through POST method, but how to send it from Delphi? And how to receive it in PHP, $request[]?

I also need a way to do it and then wait for an answer from the server, in form of other JSON object, encoded of course. It should be very simple. I have a DB online and I want to trade some data encrypted.

Thank you for your help!

Upvotes: 1

Views: 1091

Answers (1)

ciruvan
ciruvan

Reputation: 5213

Delphi doesn't have a library for that purpose so you will have to use one of the REST client libraries that can be found on the web.

This one should suit your needs just nicely.

Here is an easy example showing how to use it.

Upvotes: 2

Related Questions