We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Method put in request doesn't work with getJsonRawBody

getJsonRawBody and getRawBody methods returns empty in put methods, if i change the to post method they work.

PS: sorry for my english, i'm beginner.



2.1k

Put method is used to place files onto the server, so its a streaming process.

https://github.com/phalcon/cphalcon/blob/2.0.0/phalcon/http/request.zep#L407

from the method i can see that the content is expected to be delivered as one whole package but not as a stream of data. it is possible to alter it

var rawBody, contents, data;

let contents = fopen("php://input", "r"); while let data = fread(contents, 1024)) let rawBody .= data;