Get/post sms trb140

Hi!

I’ve a Problem with the SMS Gateway in TRB140
CURL -X GET is working,
like:
curl -X GET “http://192.168.66.9/cgi-bin/sms_total?username=user&password=Password1
I get:
Used: 13
Total: 20

but i need to get POST working
If I try the same with method POST
curl -X POST “http://192.168.66.9/cgi-bin/sms_total?username=user&password=Password1
I get the error:
Bad username or password

I’ve also tried several firmwares… no success

Any Ideas?

Kind Regards
Chris

Hello,

Thank you for reaching out.

The problem you are facing in this case is that when sending a POST request, it must be formatted differently than the GET request that you used before. That is why you are receiving bad username or password error even if you entered them correctly.
In this case the URL and body of the request need to be sent separately. For example

curl -X POST “http://192.168.66.9/cgi-bin/sms_total
-H “Content-Type: application/x-www-form-urlencoded”
-d “username=user&password=Password1”

Also, I have included Content-Type header to interpret the request body correctly, because the TRB140 expects the data to be in application/x-www-form-urlencoded format.

Using POST request in this format should return with no error.

I hope this information helps.
Kind regards,
Arnoldas

This topic was automatically closed after 15 days. New replies are no longer allowed.