Linux下使用curl命令发送GET和POST请求

1、发送get请求带请求头

在这里插入图片描述

curl -X GET "http://localhost:8080/onlinePreviewCallbackApiManagement/v1/3rd/file/info" -H "accept: */*" -H "X-Weboffice-File-Id: 123"

2、发送post请求带请求头带参数

在这里插入图片描述

curl -X POST "http://localhost:8080/onlinePreviewCallbackApiManagement/v1/3rd/file/view/notify" -H "accept: */*" -H "User-Agent: 111" -H "X-Weboffice-File-Id: 222" -H "X-Weboffice-Token: 333" -H "Content-Type: application/json" -d "{\"body\":{\"active\":0,\"counts\":0,\"detail\":\"string\",\"file_id\":\"string\",\"filesize\":0,\"filetype\":\"string\",\"maxcounts\":0,\"operated_time\":0,\"permission\":\"string\",\"result\":\"string\",\"userid\":\"string\"},\"cmd\":\"string\"}"

测试可行,后期需要可以照此发送你的请求。

猜你喜欢

转载自blog.csdn.net/zouyang920/article/details/131631859