AT commands for HTTPS - http

I've been working with a SIM808 and sending HTTP GET requests using the following AT commands:
"AT+HTTPPARA=\"CID\", 1\r\n"
"AT+HTTPINIT\r\n"
"AT+HTTPPARA=\"URL\",\"http://www.example.com/\"\r\n"
"AT+HTTPACTION=0\r\n"
"AT+HTTPREAD\r\n"
and it works fine . But when I replace the URL with https, I only receive "OK"
My question is if there is a way to use AT commands for HTTPS request methods (using SSL).

The answer is to execute AT+HTTPSSL=1 after setting the URL. Hope this helps someone

Related

Cannot send request from Postman via my IP

Strange thing - I have host API on localhost it works proper (via browser). It's a part of bigger project.
I use Postman for testing endpoints, and when I make request via localhost or 127:
-https://localhost:7257/esp32
-https://127.0.0.1:7257/esp32
Postman gives me Status 200 OK and fine data from API, but if I send request via my IP adress:
-https://192.168.8.xxx:7257/esp32 then I see error like this: Error: connect ECONNREFUSED 192.168.8.xxx:7257
What does it cause? Is it correct or no?
Ok, I need to host my application on the outside.

HTTP message via browser

Is it possible to send a HTTP message to client via browser by typing
http://CLIENT_IP:PORT/MESSAGE
http://192.168.1.1:7777/HELLO
If so could you give me some link to such project or example code ?
Yes, it is, provided you have a http server listening on port 7777 of host 192.168.1.1 that will get your message and do something with it.
Yes, you will get the message as the route or path in the server. The specific variable will vary depending on the language and framework you’re using.

Postman: configuration with symfony

I am trying to use Postman to make some requests to my API and the problem is that always I get a 404 response even when the browser gives me a 200.
Here is my Postman request:
It's very confusing. How could I fix that? Is there a problem with Postman, my Apache, my PHP?
Working with xampp (PHP 7.1.1) and the desktop version of Postman.
Update #1:
The problem seems to be the Postman as it is sending the request via proxy even with that option disabled.
When I send a request to google.com.cu all works fine (it shouldn't be because my connection is behind a proxy and Postman don't know that config).
After that, I unplugged my network, and Postman was not been able to send more requests (all good for external requests) but not for my localhost.
Does Postman need an internet connection to send localhost requests?
Update #2:
The server browser response is OK (symfony welcome page).
I can see in your request that you don’t supply a port number, just localhost and then the route - Is this intentional?
You could try just localhost:<port>/<your_route>

Plumber R post on server dosen't work

I'm building an Shiny-App with different API connections. It's all running on a server (CentOS Redhat).
I've got a problem with my API. If I'm running this on my terminal (Mac), everything works.
curl --data "InvestAmountInWei=2000000000000000000&Address=Test“ "http://s*******aw.ch:8002/invest"
Same with the Postman-App. I can do a post there and all will be done perfectly. The post request should transfer the ammount and the adress (like an id) to my r-script which is running via plumber.
As sad, if I do this command through terminal or Postman it works. But I need to do this command with the webbrowser.
I used this link to test it:
http://s*********aw.ch:8002/invest?InvestAmountInWei=1000000000000000000&Address=Jennifer
and now I only get this error in my web browser: {"error":["404 - Resource Not Found"]}
If checkt the iptables as well and it should be fine.
# netstat -ntpl | grep 8002
tcp 0 0 16*.**.**.*6:8002 0.0.0.0:* LISTEN 28563/R
any ideas how I can solve this problem?
When you make a request to a URL in your browser, that's a GET request. If you setup your endpoint to support GET and POST requests at the same location, your browser and Postman requests should both work just fine.
If you want your browser to send a POST request, you'll either need to submit a form to it or use JavaScript.

squid redirector from https to http

Got a problem with squid. I'm using 3.1 version with my own redirector.
My problem was when a client for example request https://twitter.com (with https) but somehow got a logic with my redirector that twitter.com is invalid page so i redirected this request to my invalid page. Let say 302:http://mydomain.com?invalid=twitter.com, in this stage process will not continue and browser will say "HTTP gateway failed".
So, my theory is when a request is https redirected to http, squid will not work. Is there any configuration i need to be done so that it will work?
Thank you guys..
RFC 2817 isn't very clear about the behavior of CONNECT and redirect. I think that most of the browser won't accept a redirect as a reply to the CONNECT method. So, there is no way to do what you want.
Is not an Squid issue, is a protocol/browser issue.
well, i think the best way to redirect is when:
- if the request is https the response should be https
- and if the request if http response should be http
that's the best way i can't think at the moment...

Resources