matlab URI can not access to a valid url webpage
2 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I tried to use URI to request and receive response from internet. However, it says "invalid url", while I'm pretty sure the url is correct (since I can access with web browser). I was thinking that the '|' character raised the problem.
Here is my url (I delete my key here):
Here is how I use the function.
r = RequestMessage;
uri = URI(http://maps.googleapis.com/maps/api/staticmap?center=Chicago&zoom=19&size=800x800&style=color:0x000000&style=feature:road|element:geometry|color:0xffffff&style=element:labels|visibility:off&key=XXXXXXXX);
resp = send(r,uri);
I also tried to replace '|' with '%7C', but URI cropped the string after '%'.
Thank you in advance,
0 件のコメント
回答 (1 件)
Rik
2020 年 7 月 1 日
You forgot to input the URI as a char array:
r = RequestMessage;
uri = URI('http://maps.googleapis.com/maps/api/staticmap?center=Chicago&zoom=19&size=800x800&style=color:0x000000&style=feature:road|element:geometry|color:0xffffff&style=element:labels|visibility:off&key=XXXXXXXX');
resp = send(r,uri);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Downloads についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!