0

On searching for LG TV through UPnP/SSDP, I get below response:

HTTP/1.1 200 OK
CACHE-CONTROL: max-age=172800
DATE: Mon Dec 16 06:31:03 2013 GMT
EXT:
LOCATION: http://<IP>:<PORT>/udap/api/data?target=rootservice.xml
SERVER: Linux/3.0.13 UDAP/1.0 47LN5750-UH/05.00.30
ST: udap:rootservice
USN: uuid:c8ffxxxx-xxxx-xxxx-xxxx-xxxx34b4c708::udap:rootservice

After this, using LOCATION URL provided above when I try to get the LG Smart TV description to know device info, services & commands supported, I get a "404 - Not Found" error.

Here is my code for getting decription:

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://<IP>:<PORT>/udap/api/data?target=rootservice.xml"]
                                                               cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
                                                           timeoutInterval:10];

[request setHTTPMethod: @"GET"];

NSError *requestError;
NSURLResponse *urlResponse = nil;

NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&requestError];*

Why am I getting "404 - Not Found" error when I am trying to access a URL returned by UDAP service?

Thanks in advance

4

1 回答 1

2

进行 HTTP GET 时尝试将 HTTP 标头设置User-AgentUDAP/2.0

如果您想访问 netrcu 和其他服务,请查看 UDAP 规范http://developer.lgappstv.com/TV_HELP/index.jsp?topic=%2Flge.tvsdk.references.book%2Fhtml%2FUDAP%2FUDAP%2FLG+UDAP+ 2+0+协议+规范.htm

于 2013-12-19T13:16:40.870 回答