Python、Google 地点 API - "Invalid request. One of the input parameters contains a non-UTF-8 string"
Python, Google Places API - "Invalid request. One of the input parameters contains a non-UTF-8 string"
我正在尝试使用 Google 个地方 API,但在我的一些请求中收到以下错误消息:
Invalid request. One of the input parameters contains a non-UTF-8
string.
{
"candidates" : [],
"error_message" : "Invalid request. One of the input parameters contains a non-UTF-8 string.",
"status" : "INVALID_REQUEST"
}
{
"candidates" : [
{
"formatted_address" : "9-11 Wellfield Rd, Hatfield AL10 0BS, United Kingdom",
"geometry" : {
"location" : {
"lat" : 51.7659979,
"lng" : -0.2269138
},
"viewport" : {
"northeast" : {
"lat" : 51.76722407989272,
"lng" : -0.2257391701072778
},
"southwest" : {
"lat" : 51.76452442010727,
"lng" : -0.2284388298927222
}
}
},
"name" : "Wrafton House Surgery NHS",
"photos" : [
{
"height" : 2448,
"html_attributions" : [
"\u003ca href=\"https://maps.google.com/maps/contrib/101621497138346721555/photos\"\u003eGicu Razoare\u003c/a\u003e"
],
"photo_reference" : "CmRaAAAABVxpTtU1jnkajKeMys5GsNFha4PMisyTPaw4nyhpQMH0hwOu2kDDnGhKWXpsfiXqmBAGyO5ctA86dbtavh0xWZEspctQXo1EAcJswgxdnl0zSzG5b2xMbzSK6P6lRv2QEhCIPKzSjVUEQBSM3xutYsrwGhTGcax2XoglbtUgKsRFSIJF2oaQwA",
"width" : 3264
}
],
"place_id" : "ChIJ85ML6oI8dkgRKziTLkoRGeA",
"rating" : 1.9,
"types" : [ "hospital", "point_of_interest", "establishment" ]
}
],
"status" : "OK"
}
这是因为数字吗?有没有办法通过不删除它们来解决这个问题?
导致此错误的原因是“9%11”和"AL10%0BS"中的“%”字符。您需要 encode 正确 URL。
希望对您有所帮助!
我正在尝试使用 Google 个地方 API,但在我的一些请求中收到以下错误消息:
Invalid request. One of the input parameters contains a non-UTF-8 string.
{
"candidates" : [],
"error_message" : "Invalid request. One of the input parameters contains a non-UTF-8 string.",
"status" : "INVALID_REQUEST"
}
{
"candidates" : [
{
"formatted_address" : "9-11 Wellfield Rd, Hatfield AL10 0BS, United Kingdom",
"geometry" : {
"location" : {
"lat" : 51.7659979,
"lng" : -0.2269138
},
"viewport" : {
"northeast" : {
"lat" : 51.76722407989272,
"lng" : -0.2257391701072778
},
"southwest" : {
"lat" : 51.76452442010727,
"lng" : -0.2284388298927222
}
}
},
"name" : "Wrafton House Surgery NHS",
"photos" : [
{
"height" : 2448,
"html_attributions" : [
"\u003ca href=\"https://maps.google.com/maps/contrib/101621497138346721555/photos\"\u003eGicu Razoare\u003c/a\u003e"
],
"photo_reference" : "CmRaAAAABVxpTtU1jnkajKeMys5GsNFha4PMisyTPaw4nyhpQMH0hwOu2kDDnGhKWXpsfiXqmBAGyO5ctA86dbtavh0xWZEspctQXo1EAcJswgxdnl0zSzG5b2xMbzSK6P6lRv2QEhCIPKzSjVUEQBSM3xutYsrwGhTGcax2XoglbtUgKsRFSIJF2oaQwA",
"width" : 3264
}
],
"place_id" : "ChIJ85ML6oI8dkgRKziTLkoRGeA",
"rating" : 1.9,
"types" : [ "hospital", "point_of_interest", "establishment" ]
}
],
"status" : "OK"
}
这是因为数字吗?有没有办法通过不删除它们来解决这个问题?
导致此错误的原因是“9%11”和"AL10%0BS"中的“%”字符。您需要 encode 正确 URL。
希望对您有所帮助!