If so, you need to set the appropriate headers (Content-Type and Accept,
to application/json) and pass the params as a single JSON string using
-d instead of -F.
If you want to simulate the form (i.e. not JSON, Content-Type =
multipart/form-data) then you should specify each parameter with -F
separately.
If so, you need to set the appropriate headers (Content-Type and Accept, to
application/json) and pass the params as a single JSON string using -d instead of
-F.
If you want to simulate the form (i.e. not JSON, Content-Type =
multipart/form-data) then you should specify each parameter with -F separately.
curl -F “day=24” -F “month=3” -F “year=1975” etc.
It only required changing the curl flag in the end. This did everything
I needed:
That does work, but note that it’s not a JSON request.
My Grape app uses format :json so I’m assuming JSON is returned.
It doesn’t seem that it matters for your application, but if you’re
interested, that sets the format of the response your app returns, not
the format of the requests it accepts.