Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get request raw data in PHP?

Tags:

php

I am designing a server which works as a proxy server in PHP. It just forwards the request from the client to server and replies the response from the server back to the client.

I want to read the raw request data of the client. It may include POST, GET, or multipart/form-data with files to be uploaded. How can I do it?

like image 420
Sanket Sahu Avatar asked Oct 20 '25 12:10

Sanket Sahu


1 Answers

file_get_contents("php://input");

You can see more options in php:// ("Options").

like image 54
cutsoy Avatar answered Oct 23 '25 02:10

cutsoy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!