I currently use a wifi module BX3100 ( firmware 2.5), to make http requests with APIs, I validate the tcp ip communication mode, but I can’t do GET with our http servers to test.
i think my problem come from the HTTP HEADER, because it’s little confued about ading the “\r” and the “+++”.
I use a web client to test the server response, and here is what I need to get with this server :
It’s normal ! i want to obtain this message status “401” with => “message”: …
So this is how i proceed with my module BX3100 :
Terminal => AT+SRWCFG=1,3
Rsp => OK
Terminal => AT++SRWSTACFG=xxx,xxx
Rsp => OK
Terminal => AT++SRWSTACON=1
Rsp => OK
Rsp => +SRWSTASTATUS: 1,“xxx”,“a0:ab:xx:xx:xx”,9,3
Rsp => +SRWSTAIP: “1xx.xx.1xx.11”,“255.255.255.0”,"1xx.xx.103.2xx
configure http session
AT+KHTTPCFG=0,sophia.dev-keyprod.com,80,0
Rsp => +KHTTPCFG: 1
Rsp => OK
Terminal => AT+KHTTPCNX=1
Rsp => OK
//Then I edit the Header :
Terminal => AT+KHTTPHEADER=1
Rsp => CONNECT
Accept:application/json\r\n
+++
Rsp => OK
//I check the header :
Terminal => AT+KHTTPHEADER?
Rsp =>
+KHTTPHEADER: 1,25
Accept:application/json crlf
crlf
OK
// I make the get request :
Terminal => AT+KHTTPGET=1,"api/machines"
Rsp =>
CONNECT
HTTP/1.1 400 Bad Request
Date: Sun, 19 Jan 2020 17:59:29 GMT
Server: Apache
Content-Length: 226
So the respons of the GET request, proves that i can communicate with the server, but i send GET request with the wrong format.
Sur la commande AT+KHTTPHEADER=1, i try lot of format of the header:
- i try Accept:application/json \r\n then +++
- i try Accept:application/json +++
- i try +++
I really not understand why i have this response, i should have the same reponse like the http client that i use in the beginig.
there is the log of my communication :
some one have any idea ! ? @Sierra_klin2, , maybe be you can help me ? thanks.
DIDOUH JAWAD