Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Very slow evaluation of the status code #38

Copy link
Copy link
Open
@koulombus

Description

@koulombus
Issue body actions

Hi,

I use the sample "SimpleGet" to get a UUID from a server.

The output show me a very long time on getting the status code.

making GET request

Time after get Request: 524ms
Time after get Status code: 9538ms
Time after get response body: 9566ms

Status code: 200
Response: 
{
  "uuid" : "b44c5405-7c56-4879-b4e8-ef28fc06d4a7"
}
Wait five seconds

Here the code...

void loop() {
  Serial.println("making GET request");
  long startTime = millis();
  client.get("/api/v1/uuid");

  Serial.println();
  Serial.print("Time after get Request: ");
  Serial.print(millis() - startTime);
  Serial.println("ms");

  // read the status code and body of the response
  statusCode = client.responseStatusCode();

  Serial.print("Time after get Status code: ");
  Serial.print(millis() - startTime);
  Serial.println("ms");

  response = client.responseBody();

  Serial.print("Time after get response body: ");
  Serial.print(millis() - startTime);
  Serial.println("ms");

  Serial.println();
  Serial.print("Status code: ");
  Serial.println(statusCode);
  Serial.println("Response: ");
  Serial.println(response);

  Serial.println("Wait five seconds");
  delay(5000);
}

is there something wrong with this simple code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of projectPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.