我正在关注本教程: https ://sdkdocs.roku.com/display/sdkdoc/External+Control+API ...试图通过 ssdp / http get 获取设备列表。
let query: string = "M-SEARCH * HTTP/1.1\r\n" +
"HOST: 239.255.255.250:1900\r\n" +
"MAN: \"ssdp:discover\"\r\n" +
"ST: roku: ecp\r\n\r\n";
this.http
.get(query)
.map(res => res.json())
.subscribe(
(data) => this.devices = data,
(err) => this.error = err);
...但我收到 404 错误(另外,localhost 被附加到字符串中):
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:52125/M-SEARCH%20*%20HTTP/1.1HOST:%20239.255.255.250:1900MAN:%20%22ssdp:discover%22ST:%20roku:%20ecp