Hi everyone. I'm slowly figuring out the ins and outs of C... at the moment I'm trying to create a small program that connects to a device via HTTP and sends some data via POST. I've managed to convert the MSDN existing code for my own use; at the moment I can request a file from the device.
From using Intel's UPnP tools, this is the entire data that I need to send to the device:I assume I have to put that code in the "WINHTTP_NO_ADDITIONAL_HEADERS" area of the following statement:Code:POST /AudioIn/Control HTTP/1.1 HOST: 10.0.1.136:1400 SOAPACTION: "urn:schemas-upnp-org:service:AudioIn:1#GetAudioInputName" CONTENT-TYPE: text/xml ; charset="utf-8" Content-Length: 286 <?xml version="1.0" encoding="utf-8"?> <s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <u:GetAudioInputName xmlns:u="urn:schemas-upnp-org:service:AudioIn:1" /> </s:Body> </s:Envelope>Is that right? I can post my whole code if requested, its only about 100 lines. It's very similar to the sample on MSDNCode:if( hRequest ) bResults = WinHttpSendRequest( hRequest, WINHTTP_NO_ADDITIONAL_HEADERS, 0, "sweet", 0, 0, 0 );
So... I guess my question is, is this the right way of going about a POST? Later on I'll have to recieve a response from the device but I'd like to get this down first.



LinkBack URL
About LinkBacks


