Jump to content









Photo

DFRobot Wido: Sending HTTP header in multiple lines

http header

  • Please log in to reply
No replies to this topic

#1 arnoldvillasanta

arnoldvillasanta

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 24 March 2016 - 04:43 AM

Hi,

 

Will there be any issue if the http header will be sent in chunks like the sample code by Adafruit?

I'm using DFRobot Wido board which uses a fork of CC3000 library from Adafruit...

Serial.print(F("Sending Http Headers..."));
  WidoClient.fastrprintln(F("POST /streams HTTP/1.1"));
  Serial.println("Mark 1");
  WidoClient.fastrprintln(F("Host: api.carriots.com"));
  Serial.println("Mark 2");
  WidoClient.fastrprintln(F("Accept: application/json"));
  Serial.println("Mark 3");
  WidoClient.fastrprintln(F("User-Agent: Arduino-Carriots"));
  Serial.println("Mark 4");
  WidoClient.fastrprintln(F("Content-Type: application/json"));
  Serial.println("Mark 5");
  WidoClient.fastrprint(F("carriots.apikey: "));
  Serial.println("Mark 6");
  WidoClient.fastrprintln(API_key);
  Serial.println("Mark 7");
  WidoClient.fastrprint(F("Content-Length: "));
  Serial.println("Mark 8");
  WidoClient.println(String(httpBodyPackage.length()));
  Serial.println("Mark 9");
  WidoClient.fastrprintln(F("Connection: close"));
  Serial.println("Mark 10");
  WidoClient.fastrprintln("");

Right now, the code stuck (taking more than 60 seconds) for the succeeding message block to be sent after MARK 3.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users