Send POST to Sonos

325 views
Skip to first unread message

jens.von.p...@gmail.com

unread,
Apr 12, 2018, 2:14:44 PM4/12/18
to Automate
Hi there,

I'm trying to send a command to a Sonos Play:1.
I have things I have to send already copied with wireshark. My problem is how to send this with one of the blocks the right way.
HTTP request block always fails with the special chars.

Here the code I want to send:
POST /MediaRenderer/AVTransport/Control HTTP/1.1
CONNECTION: close
ACCEPT-ENCODING: gzip
HOST: 192.168.178.46:1400
USER-AGENT: Linux UPnP/1.0 Sonos/41.3-50131 (ACR_:samsung:dreamltexx:SM-G950F)
CONTENT-LENGTH: 266
CONTENT-TYPE: text/xml; charset="utf-8"
X-SONOS-TARGET-UDN: uuid:RINCON_949F3E140B0801400
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#Play"

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:Play xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><Speed>1</Speed></u:Play></s:Body></s:Envelope>

Henrik "The Developer" Lindqvist

unread,
Apr 12, 2018, 2:50:11 PM4/12/18
to Automate
Use the HTTP request block...
Request URL: http://192.168.178.46:1400/MediaRenderer/AVTransport/Control
Request method: POST
Request content Type: XML
Request content:

"<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><s:Body><u:Play xmlns:u=\"urn:schemas-upnp-org:service:AVTransport:1\"><InstanceID>0</InstanceID><Speed>1</Speed></u:Play></s:Body></s:Envelope>"
Request headers=
{ "X-SONOS-TARGET-UDN": "uuid:RINCON_949F3E140B0801400", "SOAPACTION": "urn:schemas-upnp-org:service:AVTransport:1#Play" }

jens.von.p...@gmail.com

unread,
Apr 13, 2018, 12:46:32 AM4/13/18
to Automate
Thanks for that info!!

Gonna try this once im back from work and give info.


About the header: Do i have to add the "{}" brackets?

Henrik "The Developer" Lindqvist

unread,
Apr 13, 2018, 1:15:51 AM4/13/18
to Automate

jens.von.p...@gmail.com

unread,
Apr 13, 2018, 1:27:07 AM4/13/18
to Automate
I see my mistake. Thanks for correcting me !!

jens.von.p...@gmail.com

unread,
Apr 13, 2018, 10:03:16 AM4/13/18
to Automate
Works like a charm!!
Perfect!!
Thank you so much for your help!
Reply all
Reply to author
Forward
0 new messages