I need a HTTP function for a very simple task for the following communication. I already compared different functions / libraries - but they are too complicated for the simple job here:
Please help me. Thanks in advance.
THE REQUEST:
POST /servlet/portal/xml-api HTTP/1.1
User-Agent: Java/1.5.0_02
Host: localhost:8080
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-type: application/x-www-form-urlencoded
Content-Length: 208
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE PORTAL SYSTEM "http://localhost:8080/servlet/media/xml/api/request.dtd">
<PORTAL TransId="">
<AUTH>
<SESSION Key="OWOwZQpB6AyTxCj0" />
</AUTH>
</PORTAL>
THE RESPONSE:
HTTP/1.0 200 OK
Content-Type: text/xml
Date: Tue, 01 Nov 2005 20:32:24 GMT
Server: Tomcat Web Server/3.3a Final ( JSP 1.1; Servlet 2.2 )
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE RESPONSE SYSTEM "http://michel:8080/servlet/media/xml/api/response.dtd">
<RESPONSE TransId="" Auth="true">
</RESPONSE>
Searching for a very simple HTTP POST function
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
cURL is the only set of functions in PHP that can perform a POST without too much pain.. but it may not be built into the server(s) you run on.. fsockopen() will more likely exist, but takes more work to set up and could also be disabled.
Hi Feyd, thanks a lot for your quick answer. I need some explanation to your message:
1. but it may not be built into the server(s) you run on - you mean that either curl is not available for the php engine * operating system comination, or I don't have the appropriate compiler fot the OS ?
2. fsockopen is a part of the php core, Isn't it ? That means it is always available.. or not ?
3. "could also be disabled" - disabled ? Where on the OS level ? I saw some HTTP functions, they use that function (perhaps curl) too. Therefore HTTP will be disabled too..
Please correct me, if I'm wrong.
Thanks in advance,
Laszlo
1. but it may not be built into the server(s) you run on - you mean that either curl is not available for the php engine * operating system comination, or I don't have the appropriate compiler fot the OS ?
2. fsockopen is a part of the php core, Isn't it ? That means it is always available.. or not ?
3. "could also be disabled" - disabled ? Where on the OS level ? I saw some HTTP functions, they use that function (perhaps curl) too. Therefore HTTP will be disabled too..
Please correct me, if I'm wrong.
Thanks in advance,
Laszlo