メニュー

Expand
ページを評価:

Make HTTP Request

HTTP Request Widget

説明:

Make HTTP Request allows you to interact with applications and code that live outside Studio. Use this widget to interact with parts of your business logic not defined in flows or as Functions.

Note: Returning custom TwiML from a Make HTTP Request widget isn't supported. Use the Run Function widget instead, and follow our guide for returning custom TwiML from Twilio Functions.

必須の構成:

このWidgetに必須のフィールドはRequest MethodおよびRequest URLです。 Request Methodはドロップダウンから選択でき、URLはAutomaticに設定することができます。

名前

概要

RequestMethod

The desired HTTP method of your request (GET or POST)

Request URL

リクエストの送信先のURLです。

ヒント: URLのセキュリティーを向上させるには、Basic認証のクレデンシャルを追加します。 例: https://user:password@mydomain.com/handler.php

ContentType Content type of the request body, either application/x-www-form-urlencoded or application/json.

オプションの構成:

You may optionally decide to declare a request body and HTTP parameters for this Widget.

名前

概要

Request Body

Text to include as the body of your request.

HTTP Parameters

リクエストと一緒に渡す、パラメーターのひとつ以上のkey-valueの組です。 文字列定数と変数がサポートされます。


Transitions:

このWidgetにはTransitionをトリガーする2つのイベントがあります。

名前

概要

success

Functionの返りに成功した場合 (HTTP 20X)

Fail

The URL does not successfully return (or has an error)

レスポンス:

The HTTP response from the URL must return a 2xx status code within 10 seconds, and the response body must not exceed 64kB.

レスポンス Recommendation 注釈
Status Code 200 or 204 3xx redirection is supported. 4xx or 5xx status code will transition to "failed" in the widget.
ContentType application/json Content-Type header is not required if Status Code is 204 No Content. Other content types are supported, such as plain text or XML. But only application/json objects (e.g. {"foo":"bar"}) will be automatically parsed into Studio variables.
Body valid JSON Body content must match the Content-Type header.
Response Time 10 seconds or less Studio will timeout the request at 10 seconds and transition to "failed" in the widget.
Response Size Maximum 64kb Studio can only process responses up to 64kB.


変数:

Json: If your request returns an object in valid JSON, you will be able to access it via widgets.MY_WIDGET_NAME.parsed. Note that, although an array is valid JSON, if your request returns an array of objects, it will not be parsed.

たとえば{"message": "Hi", "person": {"name": "Bob", "age": 40}}を返すと、後続のWidget内で下記のように参照できます:

widgets.MY_WIDGET_NAME.parsed.message

widgets.MY_WIDGET_NAME.parsed.person.name

widgets.MY_WIDGET_NAME.parsed.person.age

すべての返り値の型については下記の変数があります:

widgets.MY_WIDGET_NAME.body

widgets.MY_WIDGET_NAME.status_code

widgets.MY_WIDGET_NAME.content_type

ページを評価:

ヘルプが必要ですか?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Community Forums or browsing the Twilio tag on Stack Overflow.

        
        
        

        フィードバックくださりありがとうございます!

        We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        ステップ1

        Get link

        Get a free personal referral link here

        ステップ2:

        Give $10

        Your user signs up and upgrade using link

        ステップ3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more