Home/Support/Support Forum/API Frame 0x20 Bad Request on S6B
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

API Frame 0x20 Bad Request on S6B

0 votes
When trying to make a get request from Arduino through the S6B using frame 0x20, the get request makes it to the server, according to the apache logs, but is generating an HTTP 400. If I make the same call via browser, I get the 200 I am looking for. I believe I am creating a proper http request:

The destination IP address is set in the frame.

The payload looks like:

GET /script.php?value=1234 HTTP/1.1\r\nHost:\r\n

Again this shows up in the server logs but is shown as a 400 and script.php is never hit.

The frame checks out with XCTU frame inspector.

Thank you for any help!

asked Mar 25, 2019 in Other/Legacy by jeremyhise New to the Community (1 point)

Please log in or register to answer this question.

1 Answer

0 votes
The headers for a valid HTTP/1.1 request must end with two \r\n sequences. Your example looks like it only contains one. Try adding an additional \r\n (ASCII codes 0x0D 0x0A) at the end of the payload.
answered Mar 26, 2019 by tckr Veteran of the Digi Community (514 points)