1

このブループリント リソースが問題を引き起こしています。

#Group Data Ingress

## Inbound SMS [/api/v1/inboundSMS{?number,message,key}]

### Receive [GET]

+ Request

    + Parameters

        + number (int) ... The number the sms originated from
        + message (string) ... The message content
        + key (string) ... The inbound authentication key as defined in the application configuration

+ Response 200 (text/plain)

    + Body

            OK

ご覧のとおり、単純な get リクエストです。つまり、http://my-host.com/api/v1/inboundSMS?number=123&message=hello%20world&key=SECRETKEYです。

しかし、私は apiary.io からエラーが発生しています

Line: 543 (The request line) Empty request message-body.
Line: 545 (The parameters line) Ignoring unrecognized block.

GET リクエストであるため、メッセージ本文がないため、欠落していると不平を言う理由がわかりません。

4

1 に答える 1

1

このエラーは、ヘッダーまたは本文のない「リクエスト」を定義したために発生します。パラメータ セクションは、「リクエスト」の外部に属します。

次のように Request セクションを削除し、外側のレベルに Parameters セクションを追加して、このエラーを削除できます。

## Inbound SMS [/api/v1/inboundSMS{?number,message,key}]

### Receive [GET]

+ Parameters

    + number (int) ... The number the sms originated from
    + message (string) ... The message content
    + key (string) ... The inbound authentication key as defined in the application configuration

 + Response 200 (text/plain)

    + Body

            OKAY

パラメーター セクションをアクションに配置する代わりに、リソースに移動することもできます。そのため、リソース内のすべてのアクションで共有されます。

## Inbound SMS [/api/v1/inboundSMS{?number,message,key}]

+ Parameters

    + number (int) ... The number the sms originated from
    + message (string) ... The message content
    + key (string) ... The inbound authentication key as defined in the application configuration

### Receive [GET]

 + Response 200 (text/plain)

    + Body

            OKAY
于 2014-12-17T10:36:31.523 に答える