Skip to content

Connecting client issue when sending HTTP request #3815

@staniond

Description

@staniond

Basic Infos

Hardware

Hardware: ?ESP-12?
Core Version: ?2.1.0-rc2?

Description

Hi, I want to send a request to ESP8266 and it works properly, unless I send a request which is as follows:
"[any http method] [any message] HTTP/1.1"
for example:
"GET /turnonled HTTP/1.1"
When I send this request the code exits through client timeout. If i send any other request, that does not contain GET in the beggining (or POST or any HTTP method) and HTTP/1.1 it works fine.
what is the issue? kind of strange really

Sketch

unsigned long time = millis();

while(!client.available()){
    if(millis() - time > 2500){
      Serial.println("client timeout");
      client.flush();
      return;
    }
  }

String req = client.readString();

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for feedbackWaiting on additional info. If it's not received, the issue may be closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions