以下是curl命令:
curl -H "X-API-TOKEN: <API-TOKEN>" 'http://foo.com/foo/bar' --data #
让我解释一下数据的含义
POST /foo/bar
Input (request JSON body)
Name Type
title string
body string
所以,基于这个...我得出了以下结论:
curl -H "X-API-TOKEN: " 'http://foo.com/foo/bar' --data '{"title":"foobar","body": "This body has both "double" and 'single' quotes"}'
不幸的是,我也无法弄清楚(像从cli中使用curl那样)。尽管我想用Python发送这个请求。 我该怎么做?