http - Testing API with Curl -


i'm writing api flask. testing browser works great:

http://stuff.com/login?username=test@test.com&password=testpassword

returns expect.

however, tried typing curl 2 ways (forgive ignorance, new lamp)

curl http://stuff.com/login?username=test@test.com&password=testpassword

curl -i http://stuff.com/login?username=test@test.com&password=testpassword

unfortunately, variables in query aren't making server, error message similar passing:

http://stuff.com/login?username=

help?

i believe reason because shell evaluating get arguments using, instead of passing them on string. prevent this, use single quotes around request url. example:

curl 'http://stuff.com/login?username=test@test.com&password=testpassword' 

Comments

Popular posts from this blog

tcpdump - How to check if server received packet (acknowledged) -