0

I have get reqquest like this (API key is change):

http://geohelper.info/api/v1/cities?apiKey=dddff&locale[lang]=uk&filter[name]=%D0%9F%D0%B5%D1%82%D1%80%D0%BE%D0%B7

In the get request I need to pass a parameter filter[name].

My attempts:

$.get(
                "http://geohelper.info/api/v1/cities?apiKey=ssss&locale[lang]=uk",
                {
                    filter[name]: input,
                },
            )

But in that case, return the error:

Uncaught ReferenceError: findCity is not defined at HTMLInputElement.oninput

How to pass the parameters?

Avi
  • 2,014
  • 1
  • 9
  • 21
kome
  • 51
  • 1
  • 2
  • 5
  • In documentation http://geohelper.info/ru/documentation/rules check example You just need to replace '[' with %5B and ']' with %5D. In your case "http://geohelper.info/api/v1/cities?apiKey=ssss&locale%5Blang%5D=uk" try this using your apiKey and paste this url in browser and check – Parth Savadiya Dec 24 '18 at 06:57
  • Hello, I think you are looking similar like this [link](https://stackoverflow.com/questions/15576548/how-to-pass-parameters-in-get-requests-with-jquery) – Mohd Abdul Baquee Dec 24 '18 at 09:18
  • Thanks. It is work. – kome Dec 24 '18 at 18:33
  • Possible duplicate of [How to pass parameters in GET requests with jQuery](https://stackoverflow.com/questions/15576548/how-to-pass-parameters-in-get-requests-with-jquery) – rob006 Dec 24 '18 at 19:47

0 Answers0