Handling http post with php

This is a discussion on "Handling http post with php" within the PHP Forum section. This forum, and the thread "Handling http post with php are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Aug 22nd, 2005, 21:30
New Member
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Handling http post with php

We're posting data through http post to our customers. One of our customers want this integration working with php, but they are unable to receive the post.

The connection is not a form-type connection with several parameters (like fields from an html form), but rather a stream where the data is contained in the actual body of the request.

In Java, we read this body like this:

Code: Select all
BufferedReader br = req.getReader(); //req is the incoming HttpServletRequest
String inputLine;
StringBuffer strBuffMessage = new StringBuffer();

while ((inputLine = br.readLine()) != null) {
    strBuffMessage.append(inputLine);
} // while

br.close();
We don't read any parameters; just the connection body itself.

Can this be solved with php as well?

Regards
Marius Waldal
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Aug 23rd, 2005, 09:59
New Member
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
SOLVED

It seems we solved it in a very simple way! The actual body of the post is contained in

$GLOBALS["HTTP_RAW_POST_DATA"];

This variable contains the XML we sent through the connection, so by only getting the contents here, we accomplish what we wanted.

Marius Waldal
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Aug 23rd, 2005, 12:19
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
I'm glad you sorted it out! I actually put off answering this thread until this morning thinking it would be a real brainteaser!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
handling, http, post, php

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
http post xml string and binary file in multipart message pezkel Classic ASP 0 Jun 10th, 2007 08:12
Php Image handling Accurax PHP Forum 10 Feb 27th, 2007 23:06
how to send xml file through http post or get camarun20 Other Programming Languages 5 Aug 10th, 2006 15:22
Form handling Tim356 PHP Forum 2 Feb 28th, 2005 23:55


All times are GMT. The time now is 23:49.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42