Goole Maps API - Text Search New - LocationRestriction doesn't work

105 Views Asked by At

I'm using the API Text Search, to find several locations with general request, like "Pizza Hut", and retrieve information about opening hours. I'd like to restrain my search by location, using the LocationRestriction filter.

I copied/pasted the exact same code as google provides, as an example.

I coded it with cURL, and here's the error message : curl: (6) Could not resolve host: textQuery curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535 curl: (3) URL rejected: Malformed input to a URL function curl: (3) URL rejected: Bad hostname curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535 curl: (6) Could not resolve host: application curl: (3) URL rejected: Bad hostname curl: (3) URL rejected: Bad hostname curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535 curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535

Same with Powershell, I used the exact same example as google maps, and it shows :

Invoke-RestMethod : The remote server returned an error: (400) Bad Request. At line:25 char:13

  • $response = Invoke-RestMethod -Uri $url -Method Post -Body $body -Hea ...
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Any clue on why Google Maps examples are not working ? Thank you so much for your help, Alice

0

There are 0 best solutions below