Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
PHP HTTP Request
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
jj  
View profile   Translate to Translated (View Original)
 More options 13 Mar, 12:52
From: jj <jjshea...@gmail.com>
Date: Fri, 13 Mar 2009 05:52:31 -0700 (PDT)
Local: Fri 13 Mar 2009 12:52
Subject: PHP HTTP Request
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,
J.J.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thade O'Connor  
View profile   Translate to Translated (View Original)
 More options 13 Mar, 19:36
From: "Thade O'Connor" <thade.ocon...@gmail.com>
Date: Fri, 13 Mar 2009 19:36:10 +0000
Local: Fri 13 Mar 2009 19:36
Subject: Re: [amee-developer] PHP HTTP Request

Hi J.J.

I tried that request, and got the same result as you.  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=********&password=********

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>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thade O'Connor  
View profile   Translate to Translated (View Original)
 More options 13 Mar, 19:39
From: "Thade O'Connor" <thade.ocon...@gmail.com>
Date: Fri, 13 Mar 2009 19:39:02 +0000
Local: Fri 13 Mar 2009 19:39
Subject: Re: [amee-developer] PHP HTTP Request
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=********&password=********

2009/3/13 Thade O'Connor <thade.ocon...@gmail.com>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google