2017-07-21 6 views
0

私は以下のように、自分のアプリケーションのロジックを入れているリモートメソッドがあります。Loopback.ioでアクセスインバウンドHTTPヘッダのRemote Method

module.exports = function(Entity) { 
    HcpEntity.retrieveProfile = function(body, cb) { 
    process.nextTick(function() { 
     //TODO: Application Logic 
    } 
} 
} 

を、対応するモデルJSONスニペットがある:

{ 
    "name": "HcpEntity", 
    "base": "Model", 
    "properties": {}, 
    "methods": { 
     "retrieveProfile": { 
      "isStatic" : true, 
      "accepts": [ 
       { 
        "arg": "Request", 
        "type": "object", 
        "required": true, 
        "http": { 
         "source": "body" 
        } 
       } 
      ], 
      "returns": { 
       "arg": "Response", 
       "type": "object" 
      }, 
      "http": { 
       "verb": "post" 
      } 
     } 
    } 
} 

//TODO: Application Logicとマークされた領域の受信HTTPヘッダーにアクセスして、それらを検証する必要があります。誰かが助けてくれますか?

accepts: [ {arg: 'req', type: 'object', http: {source: 'req'}} ],

要求ヘッダーがreq.headersで利用可能でなければならない - リモートメソッドaccepts使用のため

答えて

関連する問題