Author Topic: need to send via HTTP POST (not HTTP GET)  (Read 1053 times)

jcmarsalis

  • Newbie
  • *
  • Posts: 14
need to send via HTTP POST (not HTTP GET)
« on: January 05, 2024, 08:58:37 pm »
Hi I am working with DTS Autostage to send our now playing data. The want it as a HTTP POST (not HTTP GET). Can I accomplish this in Magic RDS?

Jan

  • Hero Member
  • *****
  • Posts: 1033
Re: need to send via HTTP POST (not HTTP GET)
« Reply #1 on: January 05, 2024, 10:44:47 pm »
Before we implement direct solution, you can POST the text like as showed in following example:

Code: [Select]
saveto file:"d:\post.txt"
cmd "curl -k --data-urlencode varname@d:\post.txt https://server.com/input.php"

Enter such script into the Data Distribution box (Edit Connection - Connection Type: internal channel)

Modify the script:
varname is the variable name accepted by your webserver
d:\post.txt can be changed to any local file name in any existing path
https://server.com/input.php is the URL which accepts the POST request

The text coding is UTF-8 by default.

jcmarsalis

  • Newbie
  • *
  • Posts: 14
Re: need to send via HTTP POST (not HTTP GET)
« Reply #2 on: January 06, 2024, 03:55:37 pm »
Thank you. I've implemented as you described. Will wait to see if they're getting information.

bstapley

  • Newbie
  • *
  • Posts: 2
Re: need to send via HTTP POST (not HTTP GET)
« Reply #3 on: February 02, 2024, 05:39:08 pm »
If I edit the current connection, won't I "break" the current connection to my encoder?  Also, I don't see the Data Distribution box in my current connection.  Current connection is a Kind = RDS Encoder --> Model = Generic UECP.

Before we implement direct solution, you can POST the text like as showed in following example:

Code: [Select]
saveto file:"d:\post.txt"
cmd "curl -k --data-urlencode varname@d:\post.txt https://server.com/input.php"

Enter such script into the Data Distribution box (Edit Connection - Connection Type: internal channel)

Modify the script:
varname is the variable name accepted by your webserver
d:\post.txt can be changed to any local file name in any existing path
https://server.com/input.php is the URL which accepts the POST request

The text coding is UTF-8 by default.

Jan

  • Hero Member
  • *****
  • Posts: 1033
Re: need to send via HTTP POST (not HTTP GET)
« Reply #4 on: February 02, 2024, 06:47:02 pm »
The description above does not apply to your existing connection to the RDS encoder.

Add a new Connection, kind: Bridge, connection type: internal channel. This method is also decribed in the Help: ontheweb.pdf