Search code examples
curldjango-rest-frameworkrequest

How to pass several parameters through curl in `get` request?


I execute a request of this kind: curl http://127.0.0.1:8000/api/v1/landing?param1=1&param2=2 As a result, I get only the first parameter. Why is this happening and how to fix it?


Solution

  • You must put the argument within quotes (double or single, depending on what you want and on what platform you use) so that the shell doesn't interpret the & letter.

    Like this:

    curl "http://127.0.0.1:8000/api/v1/landing?param1=1&param2=2"