How to cURL an Authenticated Django App?

后端 未结 4 1339
囚心锁ツ
囚心锁ツ 2020-12-01 05:40

I\'ve a few APIs I\'d like to test with cURL. I tried doing a GET as follows:

curl --user username:password --request GET http://my_domain/get_result/52d6428         


        
4条回答
  •  一整个雨季
    2020-12-01 06:08

    Actually @Paterino answer is correct but it will not work on every implementation of sed. Instead sed 's/^.*csrftoken\s*//') we can use sed 's/^.*csrftoken[[:blank:]]*//') which is more old fashioned. MacOSXs curl doesn't use escaping, so \n\t\s don't work at all.

提交回复
热议问题