How to resend PUT request further ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pafciu17
Forum Newbie
Posts: 2
Joined: Sat Jul 17, 2010 4:36 pm

How to resend PUT request further ?

Post 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:)
adampalmer
Forum Newbie
Posts: 2
Joined: Sat Jul 17, 2010 6:12 pm

Re: How to resend PUT request further ?

Post 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.
pafciu17
Forum Newbie
Posts: 2
Joined: Sat Jul 17, 2010 4:36 pm

Re: How to resend PUT request further ?

Post 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).
Post Reply