be-api-client
Advanced tools
Comparing version 0.0.67 to 0.0.68
15
index.js
@@ -0,1 +1,2 @@ | ||
const httpContext = require('express-http-context') | ||
const rp = require('request-promise-native') | ||
@@ -20,2 +21,5 @@ const defaultConfig = { | ||
} | ||
const userId = httpContext.get('userId') || 'unset' | ||
const requestId = httpContext.get('requestId') || 'unset' | ||
const correlationId = httpContext.get('correlationId') || 'unset' | ||
const options = { | ||
@@ -26,3 +30,6 @@ method: 'GET', | ||
headers: { | ||
'Content-Type': 'application/x-www-form-urlencoded' | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
'X-UserId': userId, | ||
'X-CorrelationId': correlationId, | ||
'X-RequestId': requestId | ||
} | ||
@@ -42,2 +49,5 @@ } | ||
async function doPost(route, form={}){ | ||
const userId = httpContext.get('userId') || 'unset' | ||
const requestId = httpContext.get('requestId') || 'unset' | ||
const correlationId = httpContext.get('correlationId') || 'unset' | ||
const options = { | ||
@@ -50,2 +60,5 @@ method: 'POST', | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
'X-UserId': userId, | ||
'X-CorrelationId': correlationId, | ||
'X-RequestId': requestId | ||
} | ||
@@ -52,0 +65,0 @@ } |
{ | ||
"name": "be-api-client", | ||
"version": "0.0.67", | ||
"version": "0.0.68", | ||
"description": "A node.js client for the be-api.", | ||
"engines": { | ||
"node": "10.15.3" | ||
}, | ||
"main": "index.js", | ||
@@ -6,0 +9,0 @@ "scripts": { |
404
12541
4