B
B
Bogdan Pasechnik2013-12-14 20:09:11
Zend Framework
Bogdan Pasechnik, 2013-12-14 20:09:11

Sending data via Request Payload with PHP?

Studied one site. And I noticed that the form is sent there not via POST. And through Request Payload (name from google chrome).
Everything looks like this.
------WebKitFormBoundaryoZrtKjxEHMWPGSi4
Content-Disposition: form-data; name="data[name]"
myname
------WebKitFormBoundaryoZrtKjxEHMWPGSi4--
I found out that the angular js framework uses such data transfer.
I also learned that with РHP this transmission is taken in this way. file_get_contents('php://input')
But I'm interested in how I can transfer this data from PHP.
Right now I'm trying to use the Zend_Http_Client library to send requests to the server.
I assume that you need to use the setRawData method. More or less like this
$client->setRawData('json string', 'application/json');
But in what format to transfer information to it, I do not know. Also not sure if that's what you need.
Any information that will allow me to get off the ground will do. Thank you for your attention.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maxaon, 2013-12-15
@maxaon

This is the "multipart/form-data" RFC 2388 format , Wiki
ZF itself must encode the data, take a closer look at the File Uploads section. You can also look at the source code, everything you need is already being done there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question