• name: Send GET request uri: url: https://api.example.com/resource method: GET return_content: yes

  • name: Send POST request with headers and body uri: url: https://api.example.com/resource method: POST headers: Content-Type: application/json body: '{"key": "value"}' return_content: yes

  • name: Send PUT request with basic authentication uri: url: https://api.example.com/resource method: PUT user: username password: password body: '{"key": "value"}' return_content: yes

In the above example, the uri module is used to send HTTP requests to various endpoints. The url parameter specifies the URL of the resource, and the method parameter specifies the HTTP method to be used (GET, POST, PUT, etc.). The headers parameter is used to provide any additional headers required for the request. The body parameter is used to send a request body, if needed. The user and password parameters can be used for basic authentication. The return_content parameter is set to yes to retrieve the response content.


原文地址: https://www.cveoy.top/t/topic/pKC6 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录