This question already has an answer here:
There are some posts about the difference between POST and GET, but my problem is more specific, here it is:
I can use GET to send and get data from the server using this VBScript example:
Send "https://www.server.com/send.php"
Sub Send(url)
Dim objHTTP, MyResponse
Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" )
objHTTP.Open "GET", url, False
objHTTP.Send "One Plus One"
MsgBox objHTTP.ResponseText()
End Sub
But this same example works if I change GET with POST, so:
And this is my PHP code on the server if you're interested:
<?php
$stdin = fopen('php://input', 'r');
$Data = '';
while (!feof($stdin))
$Data .= fread($stdin, 8192);
$Data .= " Equals Two";
echo $Data;
?>
Note that I didn't mention HTML, because my code has nothing to do with it, but if the difference has to do with HTML, I would be happy to know about it.
</div>
A POST request has a body, this body carries the information you are trying to send with the request, and the main advantage of POST is that this data can be quite lengthy, you can even send files.
GET does not have a body, if you want to send any data it has to be carried in the Query String, which is basically the stuff that goes after the ? in the URL. Example:
https://google.com/?q=this+is+the+data
As the data goes in the URL, you cant really put whatever you want there. Most browsers and servers will limit the maximum URL size to something in the order of a few kilobytes, and it is not very useful at all if you intent to post long texts or files.
if you want to send and receive data, you must have used the POST method to send data to the server that will process this data and return a result, this result can be displayed directly on the interface or saved in a file for the user. used later. the most practical method is to use JSON. for the result to be saved as a temporary file or in a * .json file.