Skip to content
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

No way to get HTTP Error code #827

Open
3 tasks done
Rsaliu opened this issue May 2, 2024 · 1 comment
Open
3 tasks done

No way to get HTTP Error code #827

Rsaliu opened this issue May 2, 2024 · 1 comment

Comments

@Rsaliu
Copy link

Rsaliu commented May 2, 2024

Answers checklist.

  • I have read the documentation ESP-AT Programming Guide and the issue is not addressed there.
  • I have used the latest released firmware or have updated my ESP-AT branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

I am working with esp-at.

I can successfully send a post request using:

AT+HTTPCPOST

After sending the post request, I got the following output with SEND OK which means that it is successful.

image

However, I can't get the error code. According to the document, it says to AT+HTTPCLIENT to get the error code but that always results in an error.

image

Kindly help on how to get HTTP error code after post request.

@ustccw
Copy link
Collaborator

ustccw commented May 17, 2024

@Rsaliu i'm sorry that AT+HTTPCPOST command does not provide a HTTP errrno after post request. it always returns the ERROR if errno > 400.
We will consider whether to add an HTTP error code in this case. As a workaround, you can catch the errno in esp_http_client_get_status_code() API, and send it by esp_at_port_write_data().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants