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

如您所见,它是一个简单的获取请求,即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 回答