Hi, I tried to get the Example HTTP-Get to run.
Now i encounter the following problem:
After I run the example with my connection data (APN, User, PW) I receive the following trace output:
2014/09/24;18:49:43:728;001;ADL;4;HTTP Client Service test application : Init
2014/09/24;18:49:46:365;001;ADL;4;http_ClientTestDataHandler: WIP_CEV_OPEN
2014/09/24;18:49:47:535;001;ADL;4;http_ClientTestDataHandler: WIP_CEV_READ
2014/09/24;18:49:47:535;002;ADL;4;http_ClientTestDataHandler: read 0 bytes
2014/09/24;18:49:47:550;001;ADL;4;http_ClientTestDataHandler: WIP_CEV_PEER_CLOSE
2014/09/24;18:49:47:550;002;ADL;4;http_ClientTestDataHandler: Status=302
2014/09/24;18:49:47:566;001;ADL;4;http_ClientTestDataHandler: Reason=“Moved Temporarily”
2014/09/24;18:49:47:566;002;ADL;4;http_ClientTestDataHandler: Content Type=“httpd/unix-directory”
2014/09/24;18:49:47:582;001;ADL;4;http_ClientTestDataHandler: Response Length=0 bytes
Now the question is: Why i receive the response code 302 (Moved Temporarily)?
I also receive this, after changing the URL.
awneil
September 24, 2014, 7:21pm
2
Because that’s the HTTP Response Code which the server returned!
OK, my fault. I have to ask more precisely.
It’s clear to me that the code was sent from the server. But why?
I expected to receive some incoming data after sending a HTTP Get request.
I tried different URLs, but every time i received 302 as response from the server (even when i’m running the unchanged HTTP-Get-Example (except the bearer connection data)).
Has anybody run the example and received some data?
awneil
September 25, 2014, 6:32am
4
Clearly, that is a question for the Server
The HTTP Status codes are sent under clearly defined conditions:
w3.org/Protocols/HTTP/HTRESP.html
en.wikipedia.org/wiki/302_Found
Obviously that will only happen if the request is valid, and for a URI that the server accepts.
By sending you a 302 Status Code, The server is telling you that it does not accept that URI - study the links above for some hints on the URI that the server will accept…
Have you tried those exact URLs in other clients; eg, a web browser
What is the result?
I just tested the http example using the 2.52 framework package. I changed the URL to
const ascii * HTTP_STR_URL = "http://www.google.se";
I also changed the APN.
It seems to be working:
2014/09/25;09:03:55:584;001;ADL;4;HTTP Client Service test application : Init
2014/09/25;09:03:56:044;001;ADL;4;http_ClientTestDataHandler: WIP_CEV_OPEN
2014/09/25;09:03:56:485;001;ADL;4;http_ClientTestDataHandler: WIP_CEV_READ
2014/09/25;09:03:56:517;001;ADL;4;http_ClientTestDataHandler: read 603 bytes
2014/09/25;09:03:56:528;001;ADL;4;http_ClientTestDataHandler: WIP_CEV_READ
2014/09/25;09:03:56:558;001;ADL;4;http_ClientTestDataHandler: read 2816 bytes
2014/09/25;09:03:56:614;001;ADL;4;http_ClientTestDataHandler: WIP_CEV_READ
2014/09/25;09:03:56:640;001;ADL;4;http_ClientTestDataHandler: read 1408 bytes
2014/09/25;09:03:56:694;001;ADL;4;http_ClientTestDataHandler: WIP_CEV_READ
2014/09/25;09:03:56:725;001;ADL;4;http_ClientTestDataHandler: read 2816 bytes
2014/09/25;09:03:56:779;001;ADL;4;http_ClientTestDataHandler: WIP_CEV_READ
2014/09/25;09:03:56:808;001;ADL;4;http_ClientTestDataHandler: read 1924 bytes
2014/09/25;09:03:56:838;001;ADL;4;http_ClientTestDataHandler: WIP_CEV_PEER_CLOSE
2014/09/25;09:03:56:845;001;ADL;4;http_ClientTestDataHandler: Status=200
2014/09/25;09:03:56:875;001;ADL;4;http_ClientTestDataHandler: Reason="OK"
2014/09/25;09:03:56:906;001;ADL;4;http_ClientTestDataHandler: Content Type="text/html; charset=ISO-8859-1"<LF>
2014/09/25;09:03:56:936;001;ADL;4;http_ClientTestDataHandler: Response Length=9567 bytes
awneil
September 25, 2014, 7:38am
6
Perhaps a tutorial on HTTP would be helpful:
jmarshall.com/easy/http/
Ha…
found the problem. The bearer-APN was wrong. It was not an HTTP issue.
Thanks for your help.
awneil
September 27, 2014, 10:40am
8
Presumably, the APN was giving the HTTP response - telling you something about the error