添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

The Send HTTP request action connects your workflow to a web server or URL and sends HTTP requests.

After Flow sends your HTTP request, it waits for a maximum of 30 seconds for an HTTP response code . If Flow hasn't received a response after 30 seconds, then it closes the connection to your app and it resends the request.

On this page

  • Fields
  • Triggers
  • Examples
  • Response codes
  • Fields

    The Send HTTP request action contains the following fields.

    Fields used in the Send HTTP request action.
    Field Description
    HTTP method The method of HTTP request to send. The Send HTTP request action supports the following methods:

  • Get - Sends a request for information from the server.
  • Delete - Removes a resource from the server.
  • Head - Retrieves the HTTP response headers of the server.
  • Options - Retrieves the options and features that are supported by the server.
  • Patch - Partially updates a resource on the server.
  • Put - Updates a resource on the server.
  • Post - Creates or replaces a resource on the server.
  • URL The URL of the server to which the HTTP request is sent.
    Headers The key and value pair for the HTTP request. Multiple key-value pairs can be entered.
    Body The content to be sent to the server.

    Triggers

    The Send HTTP request action can be used in any workflow.

    Examples

    Call the Shopify GraphQL Admin API

    In this example, you will use Flow to edit a product title by calling the productUpdate API.

    Before you begin, do the following:

    Set up and install a Custom App that has the write_products scope. You will use the API Secret Key to call the API in this example.

    Then, follow these steps in Flow:

  • Choose the Product status updated trigger, which allows you to test this workflow by changing the status on a product.
  • Add Send HTTP Request to your workflow and connect it to the trigger.
  • Open the configuration panel by clicking the Send HTTP Request step.
  • In the HTTP Method field, enter POST .
  • In the URL field, enter https://admin.shopify.com/store/shopname/api/2023-01/graphql.json substituting your shop domain and desired API Version.
  • In the Headers section, enter a Key of X-Shopify-Access-Token and Value of YOUR_API_SECRET_KEY that you obtained in the first step.
  • In the Headers section, enter a second header with Key of Content-Type and Value of application/json .
  • In the Body section, enter the following:
    {"query": "mutation { productUpdate(input: {id: \"{{ product.id }}\", title: \"{{product.title}}-edited\"}) { product { id } } }"}
  • This code adds -edited to the end of your title
  • Spaces and newlines are meaningful to the Liquid editor, so avoid adding or removing spaces. Also, except for outputting Liquid, avoid collapsing brackets like {{ and }} because they are reserved for Liquid variables.
  • Configure the rest of the workflow and activate it.
  • Test it by changing the status on a Product from Draft to Active or vice versa.
  •