POST variable if doing a POST using multipart/form
so I make this manual POST request:
Headers
User-Agent: Fiddler
Host: myhost.com
Content-Length: 11
Content-Type: multipart/form-data; boundary=xYzZY
Te: deflate,gzip;q=0.3
Connection: close
Request Body:
from=lalala
But then inspecting the $_POST variable from the site reveals that the variable is empty...
If I make it application/x-www-form-urlencoded, though
User-Agent: Fiddler
Host: myhost.com
Content-Length: 11
Content-Type: application/x-www-form-urlencoded; boundary=xYzZY
Te: deflate,gzip;q=0.3
Connection: close
The $_POST variable would get populated correctly...
Why didn't the $_POST variable get populated when using multipart/form-data? How do I go about making it work using multipart/form-data?
Because multipart/form-data
is in a totally different format. You supplied the application/x-www-form-urlencoded
format in both cases.