Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

httpGET() sends wrong header info #98

Open
GoogleCodeExporter opened this issue Mar 20, 2015 · 1 comment
Open

httpGET() sends wrong header info #98

GoogleCodeExporter opened this issue Mar 20, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Currently only some GET requests succeed because the GET request is not 
properly formulated. Each line shall be terminated by a carriage return 
followed by a line feed.

Currently implemented:
  gsm.SimpleWrite("GET ");
  gsm.SimpleWrite(path);
  gsm.SimpleWrite(" HTTP/1.0\nHost: ");
  gsm.SimpleWrite(server);
  gsm.SimpleWrite("\n");
  gsm.SimpleWrite("User-Agent: Arduino");
  gsm.SimpleWrite("\n\n");
  gsm.SimpleWrite(end_c);

Should be:
  gsm.SimpleWrite("GET ");
  gsm.SimpleWrite(path);
  gsm.SimpleWrite(" HTTP/1.0\r\nHost: ");
  gsm.SimpleWrite(server);
  gsm.SimpleWrite("\r\n");
  gsm.SimpleWrite("User-Agent: Arduino");
  gsm.SimpleWrite("\r\n\r\n");
  gsm.SimpleWrite(end_c);

see RFC for reference: 
http://www.w3.org/Protocols/HTTP/1.0/spec.html#Basic-Rules

Original issue reported on code.google.com by [email protected] on 26 Jan 2014 at 2:16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant