curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Performing a GET request with JSON

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 20 Aug 2020 09:32:04 +0200 (CEST)

On Wed, 19 Aug 2020, rafa via curl-library wrote:

> curl -X GET \
> -H "X-Parse-Application-Id: 12345_Example" \
> -H "X-Parse-REST-API-Key: abcde_Example" \
> -G \
> --data-urlencode "where={ \"pin\":\"A string\" }" \
> https://urlExample/classes/Pins

You don't want/need "-X GET" in there. -G already makes it do a GET.

> as you can see the where URL parameter constraining the value for keys
> should be encoded JSON.

You should just add the encoded JSON to end of the URL, separated with a
question mark ('?'). Something like this:

   "https://urlExample/classes/Pins?where={%20..."

-- 
  / daniel.haxx.se | Commercial curl support up to 24x7 is available!
                   | Private help, bug fixes, support, ports, new features
                   | https://www.wolfssl.com/contact/
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2020-08-20