Skip to content

Instantly share code, notes, and snippets.

@davixz
Created February 22, 2021 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davixz/78d0dbb336be1efc5ebe3f16109c5a55 to your computer and use it in GitHub Desktop.
Save davixz/78d0dbb336be1efc5ebe3f16109c5a55 to your computer and use it in GitHub Desktop.
{ Error: Request failed with status code 400
at createError (/var/www/newtail/newtail-logistic-hub/node_modules/axios/lib/core/createError.js:16:15)
at settle (/var/www/newtail/newtail-logistic-hub/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/var/www/newtail/newtail-logistic-hub/node_modules/axios/lib/adapters/http.js:244:11)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
config:
{ url: '/?=',
method: 'post',
data:
'{"query":"\\n query allShops {\\n edges {\\n node {\\n name\\n pickupInstructions\\n pk\\n address {\\n pos\\n addressSt\\n addressData\\n }\\n chargeOptions {\\n label\\n }\\n externalId\\n }\\n }\\n }\\n ","variables":{}}',
headers:
{ Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/json',
Authorization: 'davixz@gmail.com:c0795292959d511ddb0139020e7a3a027f8bf77f',
'User-Agent': 'axios/0.20.0',
'Content-Length': 427 },
baseURL: 'https://staging.loggi.com/graphql',
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 20000,
adapter: [Function: httpAdapter],
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
validateStatus: [Function: validateStatus] },
request:
ClientRequest {
_events:
[Object: null prototype] {
socket: [Function],
abort: [Function],
aborted: [Function],
connect: [Function],
error: [Function],
timeout: [Function],
prefinish: [Function: requestOnPrefinish] },
_eventsCount: 7,
_maxListeners: undefined,
output: [],
outputEncodings: [],
outputCallbacks: [],
outputSize: 0,
writable: true,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket:
TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: 'staging.loggi.com',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object],
_eventsCount: 9,
connecting: false,
_hadError: false,
_handle: [TLSWrap],
_parent: null,
_host: 'staging.loggi.com',
_readableState: [ReadableState],
readable: true,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular],
[Symbol(res)]: [TLSWrap],
[Symbol(asyncId)]: 165,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object] },
connection:
TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: 'staging.loggi.com',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object],
_eventsCount: 9,
connecting: false,
_hadError: false,
_handle: [TLSWrap],
_parent: null,
_host: 'staging.loggi.com',
_readableState: [ReadableState],
readable: true,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular],
[Symbol(res)]: [TLSWrap],
[Symbol(asyncId)]: 165,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object] },
_header:
'POST /graphql/?= HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/json\r\nAuthorization: davixz@gmail.com:c0795292959d511ddb0139020e7a3a027f8bf77f\r\nUser-Agent: axios/0.20.0\r\nContent-Length: 427\r\nHost: staging.loggi.com\r\nConnection: close\r\n\r\n',
_onPendingData: [Function: noopPendingOutput],
agent:
Agent {
_events: [Object],
_eventsCount: 1,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: [Object],
requests: {},
sockets: [Object],
freeSockets: {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
maxCachedSessions: 100,
_sessionCache: [Object] },
socketPath: undefined,
timeout: undefined,
method: 'POST',
insecureHTTPParser: undefined,
path: '/graphql/?=',
_ended: true,
res:
IncomingMessage {
_readableState: [ReadableState],
readable: false,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
socket: [TLSSocket],
connection: [TLSSocket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
headers: [Object],
rawHeaders: [Array],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 400,
statusMessage: 'Bad Request',
client: [TLSSocket],
_consuming: false,
_dumped: false,
req: [Circular],
responseUrl: 'https://staging.loggi.com/graphql/?=',
redirects: [] },
aborted: undefined,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
_redirectable:
Writable {
_writableState: [WritableState],
writable: true,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
_options: [Object],
_ended: true,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 427,
_requestBodyBuffers: [],
_onNativeResponse: [Function],
_currentRequest: [Circular],
_currentUrl: 'https://staging.loggi.com/graphql/?=',
_timeout:
Timeout {
_called: false,
_idleTimeout: -1,
_idlePrev: null,
_idleNext: null,
_idleStart: 4427,
_onTimeout: null,
_timerArgs: undefined,
_repeat: null,
_destroyed: false,
[Symbol(unrefed)]: false,
[Symbol(asyncId)]: 171,
[Symbol(triggerId)]: 168 } },
[Symbol(isCorked)]: false,
[Symbol(outHeadersKey)]:
[Object: null prototype] {
accept: [Array],
'content-type': [Array],
authorization: [Array],
'user-agent': [Array],
'content-length': [Array],
host: [Array] } },
response:
{ status: 400,
statusText: 'Bad Request',
headers:
{ server: 'nginx',
date: 'Mon, 22 Feb 2021 21:58:30 GMT',
'content-type': 'application/json',
'content-length': '111',
connection: 'close',
vary: 'Cookie, Accept-Language',
'access-control-allow-credentials': 'true',
'access-control-allow-methods': 'GET, POST, OPTIONS, PATCH',
http_x_correlation_id: 'dfb2365f-d88d-47b6-9155-df9f19cb4a24',
'content-language': 'pt-br',
'x-wsgi-duration': '0.069778',
'set-cookie': [Array],
node: 'app-server-app-0',
'x-proxy': 'staging-haproxy-01',
'x-backend': 'www_be',
'x-box': 'app_1',
'x-frame-options': ': DENY',
'x-xss-protection': ': 1;mode=block',
'strict-transport-security': 'max-age=31536000;includeSubDomains;preload',
'x-content-type-options': ': nosniff',
'access-control-allow-headers':
'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since,AppVersion' },
config:
{ url: '/?=',
method: 'post',
data:
'{"query":"\\n query allShops {\\n edges {\\n node {\\n name\\n pickupInstructions\\n pk\\n address {\\n pos\\n addressSt\\n addressData\\n }\\n chargeOptions {\\n label\\n }\\n externalId\\n }\\n }\\n }\\n ","variables":{}}',
headers: [Object],
baseURL: 'https://staging.loggi.com/graphql',
transformRequest: [Array],
transformResponse: [Array],
timeout: 20000,
adapter: [Function: httpAdapter],
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
validateStatus: [Function: validateStatus] },
request:
ClientRequest {
_events: [Object],
_eventsCount: 7,
_maxListeners: undefined,
output: [],
outputEncodings: [],
outputCallbacks: [],
outputSize: 0,
writable: true,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: [TLSSocket],
connection: [TLSSocket],
_header:
'POST /graphql/?= HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/json\r\nAuthorization: davixz@gmail.com:c0795292959d511ddb0139020e7a3a027f8bf77f\r\nUser-Agent: axios/0.20.0\r\nContent-Length: 427\r\nHost: staging.loggi.com\r\nConnection: close\r\n\r\n',
_onPendingData: [Function: noopPendingOutput],
agent: [Agent],
socketPath: undefined,
timeout: undefined,
method: 'POST',
insecureHTTPParser: undefined,
path: '/graphql/?=',
_ended: true,
res: [IncomingMessage],
aborted: undefined,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
_redirectable: [Writable],
[Symbol(isCorked)]: false,
[Symbol(outHeadersKey)]: [Object] },
data: { errors: [Array] } },
isAxiosError: true,
toJSON: [Function: toJSON] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment