-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Bad HTTP response #11375
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
Comments
HTTPClient.h line 47 clearly says #define HTTPC_ERROR_CONNECTION_REFUSED (-1), which is what I get on the output, but why? What is changed in v3.x.x? What should be changed in begin to work properly? From what I have seen, it all started from V3.x.x. There are a bunch of similar problems on the internet. |
I'd recommend you use |
When I use the very same URL address in a browser, I get what I expect, and get 200 response code. When I use this same URL here, I get -1 I tired your suggestion on my PC and get this:
I downgraded ESP32 board definitions to 2.0.16 and get:
This same code works on ESP8266. Different libs, though. |
I tried 2.0.2 and it works on ESP32. So, it is not the problem with the server, it is with the libraries. I am not sure what I wrote wrong in the code, but obviously it need to be changed to adopt the newer packages of support for the ESP32 series. |
I have one suggestion. Comment out |
The newest ESP32 packet version from the Arduino IDE. |
Since it's part of |
This did the trick. Will this be fixed in upcoming releases? |
@ITstreet1 please post the verbose debug log from serial with that change |
@ITstreet1 please also provide an actual example to reproduce the issue, because with the code above everything works as expected |
Hello,
But it passed. The code is what I have posted above, believe it or not.
|
And I must repeat myself. This code worked with zero issues on older versions of ESP32 support packages. This code works with ESP8266, too. With ESP8266 libs and support, though. |
You do not need to repeat yourself... see my output of your code below
It's not the same as yours (and I did not make the edit that I asked you to do) so what gives? |
Mate, with the exact code with site.com, I get -1 as HTTP response. |
I believe here is nothing much to see:
|
I tried with C3 and ESP32 on Arduino 3.2.0 with the same exact results as I posted above. Really strange why you see the different output and require the line to be removed. Even then, you get 200, but I get 301... what is different? How you get different HTTP result code and why can't you set the timeout of the client? |
I just tried it as is on another PC. The same board, the newest package support, everything went fine. The HTTP response, the getString(), so far zero problems So, the problem must be in some conflict with the packages of other boards or libraries I have here. What causes it, I have no idea. I will try to solve it by erasing what I don't use. |
I understand but at the same time, you see that I get a very different result than you when running on recent versions. It's only on that particular computer of yours that you have the problem. It must be some mix of core versions and external libraries getting mixed in. Closing now as resolved |
Board
ESP32 C3
Device Description
Devkit
Hardware Configuration
Nothing
Version
latest stable Release (if not listed below)
IDE Name
Arduino IDE
Operating System
Win10
Flash frequency
80MHz
PSRAM enabled
no
Upload speed
921600
Description
I tried to use my older code but always get a bad HTTP response. Can someone point me what to change?
The URL is ok, as I get the valid data over the browser with HTTP code 200.
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: