when you got this message, it seems to work.
Arduino dont support https, so i changed the api. Now you can access the api via http
Code: Select all
http://www.pushsafer.com/api
Kevin
Code: Select all
http://www.pushsafer.com/api
well, I type the line of code directly in chrome to test out the syntax, it was not send from arduinowhen you got this message, it seems to work.
Code: Select all
int length = 666;
if(client.connect("pushsafer.com",80))
{
client.println("POST /api HTTP/1.1");
client.println("Host: https://www.pushsafer.com");
client.println("Connection: close\r\nContent-Type: application/x-www-form-urlencoded");
client.print("Content-Length: ");
client.print(length);
client.println("\r\n");;
client.print("k=my_key");
client.print("&m=message");
client.print("&t=title");
client.print("&s=2");
client.print("&v=3");
client.print("&i=3");
client.print("&d=a");
client.print("&retry=60");
client.print("&expire=3600");
} else {
Serial.println("connection failed");
}
Code: Select all
HTTP/1.1 400 Bad Request
Date: Wed, 11 Jan 2017 13:32:52 GMT
Server: Apache
Content-Length: 30
Code: Select all
client.println("Host: https://www.pushsafer.com");
Code: Select all
client.println("Host: http://www.pushsafer.com");
I am not using an arduino. It's a Cortex M0 processor that use the arduino IDE.admin wrote:Arduino can not send request over https
change thistoCode: Select all
client.println("Host: https://www.pushsafer.com");
Code: Select all
client.println("Host: http://www.pushsafer.com");
Users browsing this forum: No registered users and 81 guests