Converting HTTP Post task to HTTP Request

608 views
Skip to first unread message

Peter Eliopoulos

unread,
Jan 29, 2021, 10:53:55 PM1/29/21
to Tasker
I have and HTTP Post task with the following entries to send information to a Node-Red server

Server: Port

Data / File
location=hall
state=off

It works fine, but I want to convert it to an HTTP Request task of type POST.  Every time I try and play with the variables, I get error messages and it doesn't work.  Can anyone point me to how I should format the entries in HTTP Request?

Thanks

João Dias

unread,
Feb 1, 2021, 9:45:38 AM2/1/21
to tas...@googlegroups.com
Hi. did you check the help screen for the action? :) It's explained there. Let me know if anything's missing.

Thank you for your contact.

   Join: connect multiple devices (send pushes, remote SMS, notifications) on Android, Windows, Mac, Linux
   Tasker: customize/automate anything on your phone!
   AutoApps: add advanced functionality to Tasker via plugins

     

João Dias


Peter Eliopoulos

unread,
Feb 3, 2021, 11:00:55 AM2/3/21
to Tasker
Thanks, I did a lot of checking online, but didn't think of actual in-app help.

That got me further, so I have taken what I did before and entered the following fields:

Method:
POST

URL:
192.168.0.175:1880/plug

Body:
location=hall&state=off

However, when I run that task, it doesn't register with the Node-Red server and gives me what looks to be the code for an HTML page that looks like an Error page. "Unexpected Token 1 in JSON at position 0" seems like the main part of that message. It's weird that the HTTP Post gives no issue, while the HTTP Request task gives the error.

João Dias

unread,
Feb 4, 2021, 5:55:07 AM2/4/21
to tas...@googlegroups.com
Hi again. Seems like the server is expecting a JSON body.
Can you please try setting a header in the request:
Content-Type:application/x-www-form-urlencoded
Does that make it work?
Thank you for your contact.

   Join: connect multiple devices (send pushes, remote SMS, notifications) on Android, Windows, Mac, Linux
   Tasker: customize/automate anything on your phone!
   AutoApps: add advanced functionality to Tasker via plugins

     

João Dias
--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/d71a60e1-cf5b-4ba5-b258-d27e99b9e981n%40googlegroups.com.

Peter Eliopoulos

unread,
Feb 4, 2021, 11:36:13 AM2/4/21
to Tasker
Thanks that did it!

João Dias

unread,
Feb 4, 2021, 11:43:57 AM2/4/21
to tas...@googlegroups.com
Great!

Yuriy Lipchey

unread,
Dec 19, 2021, 1:51:27 PM12/19/21
to Tasker

joaomgcd thank You! You saved my day!

четвер, 4 лютого 2021 р. о 18:43:57 UTC+2 joaomgcd пише:
Reply all
Reply to author
Forward
0 new messages