跳到主要内容

HTTP Request with YAML

List of YAML parameters and examples for the "HTTP Notification" action

YAML parameters for HTTP Request

名称类型描述
action
必填
StringThe ID of the action.
type
必填
StringThe type of the action. Should be set to HTTP.
notification_url
必填
StringThe target URL.
method_url
必填
StringThe desired HTTP method. Available values are GET, POST, PUT, PATCH or DELETE.
portStringThe port for the connection.
loginStringThe username required to connect to the server.
passwordStringThe password required to connect to the server.
contentStringThe content of the request.
headersHeader[]The headers that will be sent with the request.

YAML example for HTTP request

actions:
- action: "Send HTTP request to http://mywebserver.io"
type: "HTTP"
login: "api_tests_user"
password: "$api_tests_password"
port: "4567"
notification_url: "$url"
method: "POST"
content: "{\r\n\t\"url\": \"${BUDDY_EXECUTION_URL}\",\r\n\t\"html_url\": \"${BUDDY_EXECUTION_URL}\",\r\n\t\"id\": \"${BUDDY_EXECUTION_ID}\",\r\n\t\"start_date\": \"${BUDDY_EXECUTION_START_DATE}\",\r\n\t\"mode\": \"${BUDDY_EXECUTION_START_DATE}\",\r\n\t\"refresh\": \"${BUDDY_EXECUTION_REFRESH}\",,\r\n\t\"comment\": \"${BUDDY_EXECUTION_COMMENT}\",\r\n}"
headers:
- name: "User-Agent"
value: "Buddy"
- name: "Content-Type"
value: "application/json"
timeout: 120
variables:
- key: "url"
value: "http://mywebserver.io"