Page 1 of 1

How to resend PUT request further ?

Posted: Sat Jul 17, 2010 4:52 pm
by pafciu17
Hello,

I would like to ask is there a way to implement PHP script which would just receive PUT request and
send it to other server, wait for answer and send it back. So script would work like some request transit point.

Thank you for any suggestions:)

Re: How to resend PUT request further ?

Posted: Sat Jul 17, 2010 6:19 pm
by adampalmer
I assume you mean a "POST" request.

In which case

Code: Select all

$post_data = implode("&", $_POST);
Then use curl to send $post_data onto the next host.

Re: How to resend PUT request further ?

Posted: Sun Jul 18, 2010 10:16 am
by pafciu17
Thanks, but I meant PUT request, script is receving PUT request with specifed body, that body contains xml, that xml has to
been send to another server (that server approves only PUT request), which would process it and send back response,
also in xml form, and that xml is send in the same form to page which send first request).