Message from discussion
PHP HTTP Request
Received: by 10.210.29.17 with SMTP id c17mr81170ebc.11.1236973144048;
Fri, 13 Mar 2009 12:39:04 -0700 (PDT)
Return-Path: <thade.ocon...@gmail.com>
Received: from mail-ew0-f165.google.com (mail-ew0-f165.google.com [209.85.219.165])
by gmr-mx.google.com with ESMTP id 15si441296ewy.0.2009.03.13.12.39.03;
Fri, 13 Mar 2009 12:39:03 -0700 (PDT)
Received-SPF: pass (google.com: domain of thade.ocon...@gmail.com designates 209.85.219.165 as permitted sender) client-ip=209.85.219.165;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of thade.ocon...@gmail.com designates 209.85.219.165 as permitted sender) smtp.mail=thade.ocon...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by mail-ew0-f165.google.com with SMTP id 9so2960774ewy.9
for <amee-developer@googlegroups.com>; Fri, 13 Mar 2009 12:39:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:mime-version:received:in-reply-to:references
:date:message-id:subject:from:to:content-type
:content-transfer-encoding;
bh=c1iKQYR5EFUuE3sk1aoo2OHoee7D0mphMngTKMJi1fw=;
b=fQfy5jY+HXTC4CMxtKnTzr6XiSMqErwNw8xgIJ64e7neMZlRmv/bYyBVSTDKwmJlXb
F95BSwkKO7ptblJlrRkmliYa3jI1q5vhlDZBU3i0bm5ALo1IslXVItWyJTG0Hk3a5Bms
KygFf3s0r+iULME5s4T7WQjPXyaCtZej8hdaE=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type:content-transfer-encoding;
b=omeZ17e/28khYp1ubCAdtNDeCZEm+LqwDxNedYnrGNKqXlJ8Khhax90oHe1aQ4waC1
YRYbnyr5/7VMjMJr+nsyeIelAeZI52yEUR0BPoRYUT+HllEMMozmy1a1BMXcJccGYX7/
AmLFEXCS22KnDParh2pE/N3n11imqjrbVol/c=
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Received: by 10.216.36.84 with SMTP id v62mr912932wea.128.1236973142350; Fri,
13 Mar 2009 12:39:02 -0700 (PDT)
In-Reply-To: <e4ac36f0903131236k6eff37f2k508bd4c96c51ca6a@mail.gmail.com>
References: <4637d8dd-84a0-4e81-a3e3-6ff10f5df...@h5g2000yqh.googlegroups.com>
<e4ac36f0903131236k6eff37f2k508bd4c96c51c...@mail.gmail.com>
Date: Fri, 13 Mar 2009 19:39:02 +0000
Message-ID: <e4ac36f0903131239p5b13fb7axb38b5611a4f94...@mail.gmail.com>
Subject: Re: [amee-developer] PHP HTTP Request
From: "Thade O'Connor" <thade.ocon...@gmail.com>
To: amee-developer@googlegroups.com
Sorry, I'm not sure how that blank line got in there, it should be:
POST /auth HTTP/1.0
Accept: application/xml
Host: stage.co2.dgen.net
Content-Type: application/x-www-form-urlencoded
Content-Length: 35
username=3D********&password=3D********
2009/3/13 Thade O'Connor <thade.ocon...@gmail.com>
>
> Hi J.J.
>
> I tried that request, and got the same result as you.=A0 This one works:
>
> POST /auth HTTP/1.0
> Accept: application/xml
> Host: stage.co2.dgen.net
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 35
>
> username=3D********&password=3D********
>
> the only difference is that the Host header is stage.co2.dgen.net rather =
than http://stage.co2.dgen.net.
>
> Regards,
>
> Thade
>
> 2009/3/13 jj <jjshea...@gmail.com>
>>
>> I'm developing a website project using PHP, and the http request code
>> I have for getting authorization from the AMEE database is:
>>
>> $header =3D 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=3D/**username**/&password=3D/
>> **password**/;
>> $s =3D socket_create(AF_INET, SOCK_STREAM, 0);
>> $z =3D 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,
>> J.J.
>> >>
>