« Back to full topics list
0
0

Hi, I’m looking for some help formatting a POST request to Scriptr. I am trying to run using an ESP8266 and eventually ESP32 under the Arduino IDE. I’m good with coding, but have almost no experience with formatting POST requests. If I can get a valid sample, I can take it from there. What I’m sending currently is (line breaks in this document are just there for readability – the \r\n characters are what’s actually sent.

POST /HelloWorld/ HTTP/1.1\r\n
Host: api.scriptrapps.io\r\n
Content-type: application/x-www-form-urlencoded\r\n\r\n
authorization:bearer: xxxxxxx-68-character-token-xxxxxxxxxx\r\n
Connection: close\r\n\r\n

I connect to api.scriptrapps.io on port 80 and what I’m getting back from sending the above request is an error code returned that says the bearer token is missing in the request.

Can you tell me what I have formatted incorrectly?

Thanks, Ira –

ANSWERED
Marked as spam
Posted by - Asked on March 11, 2018 9:54 pm - 101 views

1 Replies

0
Private reply

Hello Ira,

Since your question was handled in a support request, I’m going to mark this topic as Answered. The main problem was that you cannot use token-based authentication over non-secure connections, you need to use SSL instead. Additionally, you needed to remove the colon (:) after “bearer” in your Authentication header.

Have a nice day,
Julien

Marked as spam
Posted by - Replied on March 14, 2018 1:13 pm