Send data through Request Payload with PHP

0 like 0 dislike
24 views
Studied one site. And noticed that there form is not sent through POST. But through Request Payload (name with google chrome).
It looks like this.
------WebKitFormBoundaryoZrtKjxEHMWPGSi4
Content-Disposition: form-data; name="data[name]"

myname
------WebKitFormBoundaryoZrtKjxEHMWPGSi4--
I found out that this data transmission uses a js framework angular.
Also found out that with PHP, this transfer is taken in this way. file_get_contents('php://input')
But I'm interested in how can I with PHP to send the data.
Now I am trying to use Zend_Http_Client to send requests to the server.
I assume that you can use a method setRawData. Approximately
$client->setRawData('json string', 'application/json');
But in what format to pass on to him the information I don't know. Also not sure that's what you need.
Suits me any information that will allow us to move forward. Thank you for your attention.
by | 24 views

1 Answer

0 like 0 dislike
The format is "multipart/form-data" , RFC 2388, Wiki
To encode the data itself should ZF, look carefully in the File Uploads. Can also view the source code, everything you need is already done.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
4 answers
asked Mar 28, 2019 by max_mara
0 like 0 dislike
7 answers
0 like 0 dislike
6 answers
asked Mar 22, 2019 by Mirgorod
110,608 questions
257,187 answers
0 comments
40,796 users