$ curl -v "http://192.168.1.28:8060/query/apps HTTP/1.1\r\n"
* About to connect() to 192.168.1.28 port 8060 (#0)
* Trying 192.168.1.28...
* Adding handle: conn: 0x7fbbd0804400
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fbbd0804400) send_pipe: 1, recv_pipe: 0
* Connected to 192.168.1.28 (192.168.1.28) port 8060 (#0)
> GET /query/apps HTTP/1.1\r\n HTTP/1.1
> User-Agent: curl/7.30.0
> Host: 192.168.1.28:8060
> Accept: */*
>
< HTTP/1.1 400 Bad Request
* Server Roku UPnP/1.0 MiniUPnPd/1.4 is not blacklisted
< Server: Roku UPnP/1.0 MiniUPnPd/1.4
< Content-Length: 0
tx$ = "GET /query/apps\x0D\x0A\x0D\x0A";
tx$ = "curl http://192.168.1.233:8060/query/apps\x0D\x0A\x0D\x0A"
"RokuMarkn" wrote:
Ok, you're still confused. The curl command should be typed in a Linux shell, not sent to the unit via some programmatic networking API. The curl command doesn't need any CR-LFs at the end. The GET line needs the CR-LFs at the end. Without seeing more of your code it's hard to say what you're doing wrong, but it doesn't look like you're sending the Host header, which is also required in HTTP 1.1. Did you confirm that it works in a browser as EnTerr suggested?
--Mark
STRING_FUNCTION queryServices()
{
TRACE("In queryServices Function");
tx$ = "GET /query/apps HTTP/1.1\x0D\x0A\x0D\x0A";
TRACE("tx$ = %s", tx$);
RETURN(tx$);
}
STRING_FUNCTION directAppSelect(INTEGER selApp)
{
TRACE("In directAppSelect Function");
tx$ = "POST /launch/" + service[selApp].appID + " HTTP/1.1\x0D\x0A\x0D\x0A";
currentlySelectedAppID = selApp;
TRACE("tx$ = %s", tx$);
RETURN(tx$);
}
STRING_FUNCTION keyCommand (STRING key$)
{
tx$ = "POST /" + key$ + " HTTP/1.1\x0D\x0A\x0D\x0A";
RETURN(tx$);
}