how to open an HTTP input stream in PHP?
Posted: Mon Nov 18, 2002 5:49 am
Hi,
it would be fine if someone could give me an idea of how to get the data from an HTTP stream with PHP.
On client side there is a HTTP connection opened with the post method. Afterwards a output stream is defined in which data is transferred to the host. How can I get all the data sent via this stream?
This is how the client side could look like:
conn = (HttpConnection)Connector.open(url);
conn.setRequestMethod(HttpConnection.POST);
conn.setRequestproperty("Content-Length", Integer.toString(request.length()));
out = conn.openOutputStream();
int requestLength = request.length();
for (int i=0; i<requestLength; ++i)
{
out.write(request.charAt(i));
}
How can I get the data transferred via the output stream of the String "request" in PHP?
I have browsed the PHP spec but I have not found how to solve this problem.
Thanks!
it would be fine if someone could give me an idea of how to get the data from an HTTP stream with PHP.
On client side there is a HTTP connection opened with the post method. Afterwards a output stream is defined in which data is transferred to the host. How can I get all the data sent via this stream?
This is how the client side could look like:
conn = (HttpConnection)Connector.open(url);
conn.setRequestMethod(HttpConnection.POST);
conn.setRequestproperty("Content-Length", Integer.toString(request.length()));
out = conn.openOutputStream();
int requestLength = request.length();
for (int i=0; i<requestLength; ++i)
{
out.write(request.charAt(i));
}
How can I get the data transferred via the output stream of the String "request" in PHP?
I have browsed the PHP spec but I have not found how to solve this problem.
Thanks!