send/post xml file using curl command line

2019-01-03 11:46发布

How can I send/post an xml file to a local server http://localhost:8080 using curl from the command line?

What command should I use?

8条回答
干净又极端
2楼-- · 2019-01-03 12:06

If you have multiple headers then you might want to use the following:

curl -X POST --header "Content-Type:application/json" --header "X-Auth:AuthKey" --data @hello.json Your_url
查看更多
趁早两清
3楼-- · 2019-01-03 12:13

You can use this command:

curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --header 'Authorization: <<Removed>>' -F file=@"/home/xxx/Desktop/customers.json"  'API_SERVER_URL' -k 
查看更多
登录 后发表回答