Home/Support/Support Forum/API HTTP GET Request on the Cellular 3G
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

API HTTP GET Request on the Cellular 3G

0 votes
Hi,

I am having the same kind of trouble as the user who posted this:
https://www.digi.com/support/forum/66120/http-get-in-api-mode-on-xbee-lte-cat-1

I am trying to perform a simple HTTP GET request on httpbin.org using the API mode. I have been able to do it using putty, both with the url and its IP address, which is 54.225.153.22. I found it using https://www.site24x7.com/find-ip-address-of-web-site.html.

When I perform the following request:
(newline)
GET /get HTTP/1.0
HOST: www.httpbin.org
(newline)

I receive the intended result, using putty, and the connection closing. Both happens when using the url and IP address.

When trying to do the same using the API mode I receive a TX status, notifying me that the connection is lost, and nothing else.

The frame I am sending is the following, generated using XCTU:
7E 00 38 20 01 36 E1 99 16 00 50 00 01 01 00 0D 0A 47 45 54 20 2F 67 65 74 20 48 54 54 50 2F 31 2E 30 0D 0A 48 4F 53 54 3A 20 77 77 77 2E 68 74 74 70 62 69 6E 2E 6F 72 67 0D 0A 5A

Any kind of help would be greatly appreciated.

Thank you all in advance.

Edit:
I solved the problem. I changed the port number like tckr suggested, and added another newline to the payload (0D 0A), like mvut suggested..
asked Apr 17, 2018 in Digi Connect Cellular by haakoneh New to the Community (3 points)
edited Apr 18, 2018 by haakoneh

Please log in or register to answer this question.

2 Answers

0 votes
 
Best answer
May I suggest you copy the following data packet into the data portion of your API frame.

47 45 54 20 2F 69 70 20 48 54 54 50 2F 31 2E 31 0D 0A 48 6F 73 74 3A 20 68 74 74 70 62 69 6E 2E 6F 72 67 0D 0A 0D 0A

You will find that it is accurate as to what the data portion needs to be for the HTTP get to work.
answered Apr 17, 2018 by mvut Veteran of the Digi Community (11,354 points)
selected Apr 18, 2018 by haakoneh
0 votes
It looks like you are specifying a source port of 1 (00 01). This needs to be 0 (00 00), otherwise XBee Cellular will give the "connection lost" status because there is no existing connection with local port 1.
answered Apr 17, 2018 by tckr Seasoned Professional (227 points)
...