如何调试https post issue适用于REST客户端而不是lambda

时间:2016-08-07 06:31:34

标签: rest post aws-lambda

我正在通过amazon lambda函数进行POST调用,如下所示

    var noteBody = 
                            {
                              ...
    };

 var options = {
      appid: "amzn1.echo-sdk-ams.app.your-app-id",
      host: hostName,
      path: aptmtPath,
      method: "POST",
      json: true,
      'gzip': true,
      headers: {
                        Authorization: 'Basic ' + auth,
                        'Content-Type': 'application/vnd.oracle.adf.resourceitem+json'

                    },
      body: noteBody
    };  


         https.get(options, function(res) {
            console.log("note creation response received with response code:" + res.statusCode);

响应代码打印201.这意味着成功发布。但是,我没有看到任何数据发布。

当我尝试使用称为REST客户端的chrome扩展时,它也能正常工作。这是原始请求的样子(有效)

Authorization: Basic XXXX
Content-Type: application/vnd.oracle.adf.resourceitem+json
Cookie: JSESSIONID=_y1lmLqOsH-SQ5EhMTOghRW0W2ThiQwehDk0QAc6hWl5dqLTxjw1!492604637; ORA_FND_SESSION_FUSIONDB=DEFAULT_PILLAR:3tzuXU7XnpS8szvj4S0U4Lauq0eiS4E40GSWytkui3yGUy75ABCWWIErvUozaYHR:1470447149500; ORA_FUSION_PREFS=v1.0~bG9jYWxlPWVufmRlZmF1bHRMYW5ndWFnZU1hcmtlcj10cnVl
Content-Length: 108

来源消息

POST /salesApi/resources/11.1.11/activities/308673/child/Note HTTP/1.1
 HOST: XXXX
 authorization: Basic XXX
 content-type: application/vnd.oracle.adf.resourceitem+json
 cookie: JSESSIONID=_y1lmLqOsH-SQ5EhMTOghRW0W2ThiQwehDk0QAc6hWl5dqLTxjw1!492604637; ORA_FND_SESSION_FUSIONDB=DEFAULT_PILLAR:3tzuXU7XnpS8szvj4S0U4Lauq0eiS4E40GSWytkui3yGUy75ABCWWIErvUozaYHR:1470447149500; ORA_FUSION_PREFS=v1.0~bG9jYWxlPWVufmRlZmF1bHRMYW5ndWFnZU1hcmtlcj10cnVl
 content-length: 108

 {
 "NoteTxt" : "dGVzdCBub3RlIGZyb20gY2hyb21l",
 "NoteTypeCode" : "GENERAL",
 "VisibilityCode": "INTERNAL"
 }

如何调试?

0 个答案:

没有答案