I need to set php header("Content-Length: length"), where length is a byte value. Right now I have arbitrarily set it to 1 megabyte due to the variable size of my post request, but I want to dynamically generate this so that there isn’t erroneous data.
How can I get the byte size of my object before I send it to the server. I am making a soapCall so I have to set the header before I do that call, instead of adding a parameter to curl or something.
You can do the following (there ought to be something better, I know):