Skip to content

Slow GET response times using v1.7.2 of adafruit_requests #42

Closed
@DeanDavis

Description

@DeanDavis

This is a cross-post from the forum site but after experimenting more, this is either a hardware issue or an issue with the adafruit_requests library.
The quick version is that it's taking over a minute to get a response from some URLs using adafruit_requests and this is not an issue of the server side.

First Hardware:
Adafruit Matrix Portal running 6.0.0rc0 CircuitPython
ESP32 updated to firmware 1.7.1
WiFi SSID RSSI is 67 on connection

Testing method:
Used this code for basic test
https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/blob/master/examples/esp32spi_simpletest.py
Ran this code using library adafruit_requests v1.7.2
Running the code as is results in successful test. Everything seems to be responsive.

But if I switch that code's "JSON_URL" from the one supplied to a URL I'm interested in
MLB Game Results
It takes over a minute (and sometimes outright fails) to return data.
This URL returns data instantly in a browser or using a tool like Postman.

Also, the call to requests.get (seen below) does return immediately.
In the code block below (taken and modified from the example) the status code is printed immediately.
The minute long pause in the code comes at the r.json() call

print("Fetching json from", JSON_URL)
r = requests.get(JSON_URL)
print("-" * 40)
print("Status Code {}".format(r.status_code))
print(r.json())
print("-" * 40)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions