跳到主要内容

HTTP 请求-简单GET请求

在流程中发送 GET 请求

问题背景

在流程中发送 GET 请求

解决方案

使用 HTTP 请求API 调用 节点发出 HTTP 请求

示例

http-request-sample-get

示例JSON

[{"id":"d88dd470.0ac7b8","type":"inject","z":"65b5dbf44a0ca401","name":"注入","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":190,"y":3060,"wires":[["874a3d4e.9b666"]]},{"id":"874a3d4e.9b666","type":"http request","z":"65b5dbf44a0ca401","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://jsonplaceholder.typicode.com/todos/1","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":394.5,"y":3060,"wires":[["7403c68f.21d7c8"]]},{"id":"7403c68f.21d7c8","type":"debug","z":"65b5dbf44a0ca401","active":true,"console":"false","complete":"false","x":610,"y":3060,"wires":[]},{"id":"c2dfda6825525269","type":"open-api","z":"65b5dbf44a0ca401","name":"","baseApiGatewayUrl":"https://jsonplaceholder.typicode.com","basePath":"","apiType":"customAPI","applicationOption":"None","apiTag":"","api":"","description":"","props":[],"requestType":"","configType":"keyValue","manualSyntaxType":"json","manualValue":"","messageValue":"","customConfigType":"paramConfig","customTemplate":"{\n  \"path\": \"/api/v1/open/department/detail/{{fieldName}}\",\n  \"method\": \"GET\",\n  \"body\": {}\n}","customTemplateSyntax":"json","customUrl":"/todos/1","customRequestMethod":"get","customParam":[],"customPath":[],"customBody":{"bodyType":"json","bodyJsonValue":[],"bodyRawValue":"","formatType":"json"},"customHeader":[],"x":400,"y":3140,"wires":[["c6e20892522f4fa6"]]},{"id":"8d7e18710dfde97d","type":"inject","z":"65b5dbf44a0ca401","name":"注入","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":190,"y":3140,"wires":[["c2dfda6825525269"]]},{"id":"75f8288896e2950a","type":"debug","z":"65b5dbf44a0ca401","logName":"日志输出","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"apiGatewayRes","targetType":"msg","statusVal":"","statusType":"auto","logLevel":"info","dataType":"field","format":"handlebars","syntax":"mustache","template":"输出日志: payload 值为 {{payload}}","output":"str","x":770,"y":3140,"wires":[]},{"id":"c6e20892522f4fa6","type":"change","z":"65b5dbf44a0ca401","name":"调整消息属性","rules":[{"t":"set","p":"payload","pt":"msg","to":"apiGatewayRes","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":3140,"wires":[["75f8288896e2950a"]]}]

运行结果

http-request-sample-get-result