Capturing/ Consuming Content

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Capturing/ Consuming Content

Post by kendall »

Hi,

I am creating a web service in which i am posting parameters to a web service using curl. I am now faced with a situation in which the web service needs to me to create a web service to consume a response HTML/ XML POSTEd content from them...My question is...How do i create a web service to "capture" "content" information for e.g. a page

to use pseudo code to help understand the process....

1) I send information to the service via curl and recieve a response which leads me to
a) continue on with my process
b) provide the information to the user for input which is captured by the service directly
2) the service then sends content to me which i must consume/ parse in order to analyse the response

It is the 2) part that is confusing to me...usually if its a form you would simply use $_POST environment to get eh information....however the content coming back to me is in the form

Code: Select all

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<string >RESPONSEDATA</string>
In which RESPONSEDATA is url encoded...

So my question is "how" to i capture this raw data in a php variable? :?:
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Capturing/ Consuming Content

Post by Christopher »

It looks like what is coming back to you is XML. So parse the XML first. If the data you get from an XML field is URL encoded, then decode and parse the URL string.
(#10850)
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Re: Capturing/ Consuming Content

Post by kendall »

arborint wrote:It looks like what is coming back to you is XML. So parse the XML first. If the data you get from an XML field is URL encoded, then decode and parse the URL string.
Well i know this but what i want to know is how do i
So parse the XML first. If the data you get from an XML field is URL encoded, then decode and parse the URL string.
I'm doing some research on $HTTP_RAW_POST_DATA not sure how this is suppose to work though
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Capturing/ Consuming Content

Post by RobertGonzalez »

Last edited by RobertGonzalez on Fri Apr 18, 2008 11:27 am, edited 1 time in total.
Reason: Can't type this morning
Post Reply