Using Http request

The Automation Studio provides templates that can be used in various use cases. Template provides Flow examples for each situation, so you can create Flows faster and easier.

Through this tutorial, you can learn ...

  • How to define the method and URL of the endpoint using the 'Http request' node.
  • How to use the function node.
  • How to control flow using decision nodes.
  • How to define HTTP responses.

Example

  1. Configure an API endpoint using the 'Http request' node.
    a. Enter the method and URL information of the HTTP request.
    b. Request the information sent via the 'msg' object.
  • msg.payload : request a string query and request body.
  • msg.req : HTTP request object.
  • msg.req has body/headers/query/params/cookies properties.
  1. Process the HTTP request.
    a. Process the request with the 'msg' object properties.
    b. Use the flow decision nodes or function nodes.
  • Run a javascript function by using the 'function' node.
  • Branch according to the specific property value by using a switch node.
  • Define the msg.payload value by using the change node.
  1. Define the HTTP Response.
    a. Pass the value of the msg.payload to the response body.
    b. Define the response of the status code and header.
    c. And define the cookies by defining the msg.cookie property.