コンテンツにスキップ

HTTP/RESTコネクタ

HTTPコネクタは、REST APIおよびWebサービスとの通信を可能にします。

コネクタタイプ:

  • HttpReader - HTTPエンドポイントをポーリング(GETリクエスト)
  • HttpWriter - HTTPエンドポイントにデータを送信(POST、PUT、DELETE)

HTTPエンドポイントを定期的にポーリング:

{
"type": "HttpReader",
"config": {
"endpoint": "http://api.example.com/data",
"pollingRate": 5000,
"method": "GET",
"headers": {
"Authorization": "Bearer YOUR_TOKEN",
"Accept": "application/json"
}
}
}

POSTでデータを送信:

{
"type": "HttpWriter",
"config": {
"endpoint": "http://api.example.com/data",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN"
}
}
}

PUTでデータを更新:

{
"type": "HttpWriter",
"config": {
"endpoint": "http://api.example.com/data/123",
"method": "PUT",
"headers": {
"Content-Type": "application/json"
}
}
}
  • endpoint: プロトコルを含む完全なURL
  • method: HTTPメソッド(GET、POST、PUT、DELETE)
  • pollingRate: (リーダーのみ)ミリ秒単位のポーリング間隔
  • headers: カスタムHTTPヘッダー(オブジェクト)
  • timeout: (オプション)ミリ秒単位のリクエストタイムアウト
{
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer token",
"Accept": "application/json",
"User-Agent": "Meddle/1.0"
}
}
{
"type": "HttpReader",
"config": {
"endpoint": "https://api.weather.com/v1/current?location=factory",
"pollingRate": 300000,
"method": "GET",
"headers": {
"API-Key": "your-api-key"
}
}
}
{
"type": "HttpWriter",
"config": {
"endpoint": "https://hooks.example.com/webhook",
"method": "POST",
"headers": {
"Content-Type": "application/json"
}
}
}
  • MQTT - IoTメッセージング代替
  • Reshape - HTTP応答を変換