Message from discussion
PHP HTTP Request
MIME-Version: 1.0
Received: by 10.100.231.16 with SMTP id d16mr163536anh.20.1236948751499; Fri,
13 Mar 2009 05:52:31 -0700 (PDT)
Date: Fri, 13 Mar 2009 05:52:31 -0700 (PDT)
X-IP: 89.204.243.178
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6;
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322;
.NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
Message-ID: <4637d8dd-84a0-4e81-a3e3-6ff10f5df265@h5g2000yqh.googlegroups.com>
Subject: PHP HTTP Request
From: jj <jjshea...@gmail.com>
To: Amee Developer <amee-developer@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
I'm developing a website project using PHP, and the http request code
I have for getting authorization from the AMEE database is:
$header = POST /auth HTTP/1.0\nAccept: application/xml\nHost:
http://stage.co2.dgen.net\nContent-Type: application/x-www-form-
urlencoded\nContent-Length: 36\n\nusername=/**username**/&password=/
**password**/;
$s = socket_create(AF_INET, SOCK_STREAM, 0);
$z = socket_connect($s, "193.34.29.200", $port);
socket_write($s, $header, strlen($header));
I got this code from the php with sockets example in the developers
area of the AMEE website.
This code is creating the connection between my website and the AMEE
website, but the http request above is causing a 400 bad request
error.
How do I change this code to get the authorisation token from the AMEE
website?
Thanks,