Advertisement
Guest User

Dropbox oauth request.js SO problem

a guest
Jan 27th, 2016
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 48.54 KB | None | 0 0
  1. $ node getToken.js
  2. resp:  IncomingMessage {
  3.   _readableState:
  4.    ReadableState {
  5.      objectMode: false,
  6.      highWaterMark: 16384,
  7.      buffer: [],
  8.      length: 0,
  9.      pipes: null,
  10.      pipesCount: 0,
  11.      flowing: true,
  12.      ended: true,
  13.      endEmitted: true,
  14.      reading: false,
  15.      sync: true,
  16.      needReadable: false,
  17.      emittedReadable: false,
  18.      readableListening: false,
  19.      resumeScheduled: false,
  20.      defaultEncoding: 'utf8',
  21.      ranOut: false,
  22.      awaitDrain: 0,
  23.      readingMore: false,
  24.      decoder: null,
  25.      encoding: null },
  26.   readable: false,
  27.   domain: null,
  28.   _events:
  29.    { end: [ [Function: responseOnEnd], [Function], [Function], [Function] ],
  30.      close: [ [Function], [Function] ],
  31.      data: [Function],
  32.      error: [Function] },
  33.   _eventsCount: 4,
  34.   _maxListeners: undefined,
  35.   socket:
  36.    TLSSocket {
  37.      _tlsOptions:
  38.       { pipe: null,
  39.         secureContext: [Object],
  40.         isServer: false,
  41.         requestCert: true,
  42.         rejectUnauthorized: true,
  43.         session: undefined,
  44.         NPNProtocols: undefined,
  45.         ALPNProtocols: undefined,
  46.         requestOCSP: undefined },
  47.      _secureEstablished: true,
  48.      _securePending: false,
  49.      _newSessionPending: false,
  50.      _controlReleased: true,
  51.      _SNICallback: null,
  52.      servername: null,
  53.      npnProtocol: false,
  54.      alpnProtocol: false,
  55.      authorized: true,
  56.      authorizationError: null,
  57.      encrypted: true,
  58.      _events:
  59.       { close: [Object],
  60.         end: [Object],
  61.         finish: [Function: onSocketFinish],
  62.         _socketEnd: [Function: onSocketEnd],
  63.         secure: [Function],
  64.         free: [Function: onFree],
  65.         agentRemove: [Function: onRemove],
  66.         drain: [Function: ondrain],
  67.         error: [Object] },
  68.      _eventsCount: 9,
  69.      _connecting: false,
  70.      _hadError: false,
  71.      _handle: null,
  72.      _parent: null,
  73.      _host: 'api.dropboxapi.com',
  74.      _readableState:
  75.       ReadableState {
  76.         objectMode: false,
  77.         highWaterMark: 16384,
  78.         buffer: [],
  79.         length: 0,
  80.         pipes: null,
  81.         pipesCount: 0,
  82.         flowing: true,
  83.         ended: false,
  84.         endEmitted: false,
  85.         reading: true,
  86.         sync: false,
  87.         needReadable: true,
  88.         emittedReadable: false,
  89.         readableListening: false,
  90.         resumeScheduled: false,
  91.         defaultEncoding: 'utf8',
  92.         ranOut: false,
  93.         awaitDrain: 0,
  94.         readingMore: false,
  95.         decoder: null,
  96.         encoding: null },
  97.      readable: false,
  98.      domain: null,
  99.      _maxListeners: 0,
  100.      _writableState:
  101.       WritableState {
  102.         objectMode: false,
  103.         highWaterMark: 16384,
  104.         needDrain: false,
  105.         ending: true,
  106.         ended: true,
  107.         finished: true,
  108.         decodeStrings: false,
  109.         defaultEncoding: 'utf8',
  110.         length: 0,
  111.         writing: false,
  112.         corked: 0,
  113.         sync: false,
  114.         bufferProcessing: false,
  115.         onwrite: [Function],
  116.         writecb: null,
  117.         writelen: 0,
  118.         bufferedRequest: null,
  119.         lastBufferedRequest: null,
  120.         pendingcb: 0,
  121.         prefinished: true,
  122.         errorEmitted: false },
  123.      writable: false,
  124.      allowHalfOpen: false,
  125.      destroyed: true,
  126.      bytesRead: 316,
  127.      _bytesDispatched: 311,
  128.      _sockname: null,
  129.      _pendingData: null,
  130.      _pendingEncoding: '',
  131.      ssl:
  132.       TLSWrap {
  133.         _externalStream: {},
  134.         fd: -22,
  135.         _parent: [Object],
  136.         _parentWrap: undefined,
  137.         _secureContext: [Object],
  138.         reading: true,
  139.         owner: [Circular],
  140.         onread: [Function: noop],
  141.         writeQueueSize: 1,
  142.         onhandshakestart: [Function],
  143.         onhandshakedone: [Function],
  144.         onocspresponse: [Function],
  145.         onerror: [Function] },
  146.      server: undefined,
  147.      _requestCert: true,
  148.      _rejectUnauthorized: true,
  149.      parser: null,
  150.      _httpMessage:
  151.       ClientRequest {
  152.         domain: null,
  153.         _events: [Object],
  154.         _eventsCount: 4,
  155.         _maxListeners: undefined,
  156.         output: [],
  157.         outputEncodings: [],
  158.         outputCallbacks: [],
  159.         outputSize: 0,
  160.         writable: true,
  161.         _last: true,
  162.         chunkedEncoding: false,
  163.         shouldKeepAlive: false,
  164.         useChunkedEncodingByDefault: true,
  165.         sendDate: false,
  166.         _removedHeader: [Object],
  167.         _contentLength: null,
  168.         _hasBody: true,
  169.         _trailer: '',
  170.         finished: true,
  171.         _headerSent: true,
  172.         socket: [Circular],
  173.         connection: [Circular],
  174.         _header: 'POST /1/oauth2/token HTTP/1.1\r\nhost: api.dropboxapi.com\r\nauthorization: Basic M2dlcnl3cnFwa2sxajVqOmd3eDNpOWY1cW03aTg3cg==\r\naccept: application/json\r\ncontent-type: application/json\r\ncontent-length: 88\r\nConnection: close\r\n\r\n',
  175.         _headers: [Object],
  176.         _headerNames: [Object],
  177.         _onPendingData: null,
  178.         agent: [Object],
  179.         socketPath: undefined,
  180.         method: 'POST',
  181.         path: '/1/oauth2/token',
  182.         parser: null,
  183.         res: [Circular] },
  184.      read: [Function],
  185.      _consuming: true,
  186.      _idleNext: null,
  187.      _idlePrev: null,
  188.      _idleTimeout: -1 },
  189.   connection:
  190.    TLSSocket {
  191.      _tlsOptions:
  192.       { pipe: null,
  193.         secureContext: [Object],
  194.         isServer: false,
  195.         requestCert: true,
  196.         rejectUnauthorized: true,
  197.         session: undefined,
  198.         NPNProtocols: undefined,
  199.         ALPNProtocols: undefined,
  200.         requestOCSP: undefined },
  201.      _secureEstablished: true,
  202.      _securePending: false,
  203.      _newSessionPending: false,
  204.      _controlReleased: true,
  205.      _SNICallback: null,
  206.      servername: null,
  207.      npnProtocol: false,
  208.      alpnProtocol: false,
  209.      authorized: true,
  210.      authorizationError: null,
  211.      encrypted: true,
  212.      _events:
  213.       { close: [Object],
  214.         end: [Object],
  215.         finish: [Function: onSocketFinish],
  216.         _socketEnd: [Function: onSocketEnd],
  217.         secure: [Function],
  218.         free: [Function: onFree],
  219.         agentRemove: [Function: onRemove],
  220.         drain: [Function: ondrain],
  221.         error: [Object] },
  222.      _eventsCount: 9,
  223.      _connecting: false,
  224.      _hadError: false,
  225.      _handle: null,
  226.      _parent: null,
  227.      _host: 'api.dropboxapi.com',
  228.      _readableState:
  229.       ReadableState {
  230.         objectMode: false,
  231.         highWaterMark: 16384,
  232.         buffer: [],
  233.         length: 0,
  234.         pipes: null,
  235.         pipesCount: 0,
  236.         flowing: true,
  237.         ended: false,
  238.         endEmitted: false,
  239.         reading: true,
  240.         sync: false,
  241.         needReadable: true,
  242.         emittedReadable: false,
  243.         readableListening: false,
  244.         resumeScheduled: false,
  245.         defaultEncoding: 'utf8',
  246.         ranOut: false,
  247.         awaitDrain: 0,
  248.         readingMore: false,
  249.         decoder: null,
  250.         encoding: null },
  251.      readable: false,
  252.      domain: null,
  253.      _maxListeners: 0,
  254.      _writableState:
  255.       WritableState {
  256.         objectMode: false,
  257.         highWaterMark: 16384,
  258.         needDrain: false,
  259.         ending: true,
  260.         ended: true,
  261.         finished: true,
  262.         decodeStrings: false,
  263.         defaultEncoding: 'utf8',
  264.         length: 0,
  265.         writing: false,
  266.         corked: 0,
  267.         sync: false,
  268.         bufferProcessing: false,
  269.         onwrite: [Function],
  270.         writecb: null,
  271.         writelen: 0,
  272.         bufferedRequest: null,
  273.         lastBufferedRequest: null,
  274.         pendingcb: 0,
  275.         prefinished: true,
  276.         errorEmitted: false },
  277.      writable: false,
  278.      allowHalfOpen: false,
  279.      destroyed: true,
  280.      bytesRead: 316,
  281.      _bytesDispatched: 311,
  282.      _sockname: null,
  283.      _pendingData: null,
  284.      _pendingEncoding: '',
  285.      ssl:
  286.       TLSWrap {
  287.         _externalStream: {},
  288.         fd: -22,
  289.         _parent: [Object],
  290.         _parentWrap: undefined,
  291.         _secureContext: [Object],
  292.         reading: true,
  293.         owner: [Circular],
  294.         onread: [Function: noop],
  295.         writeQueueSize: 1,
  296.         onhandshakestart: [Function],
  297.         onhandshakedone: [Function],
  298.         onocspresponse: [Function],
  299.         onerror: [Function] },
  300.      server: undefined,
  301.      _requestCert: true,
  302.      _rejectUnauthorized: true,
  303.      parser: null,
  304.      _httpMessage:
  305.       ClientRequest {
  306.         domain: null,
  307.         _events: [Object],
  308.         _eventsCount: 4,
  309.         _maxListeners: undefined,
  310.         output: [],
  311.         outputEncodings: [],
  312.         outputCallbacks: [],
  313.         outputSize: 0,
  314.         writable: true,
  315.         _last: true,
  316.         chunkedEncoding: false,
  317.         shouldKeepAlive: false,
  318.         useChunkedEncodingByDefault: true,
  319.         sendDate: false,
  320.         _removedHeader: [Object],
  321.         _contentLength: null,
  322.         _hasBody: true,
  323.         _trailer: '',
  324.         finished: true,
  325.         _headerSent: true,
  326.         socket: [Circular],
  327.         connection: [Circular],
  328.         _header: 'POST /1/oauth2/token HTTP/1.1\r\nhost: api.dropboxapi.com\r\nauthorization: Basic M2dlcnl3cnFwa2sxajVqOmd3eDNpOWY1cW03aTg3cg==\r\naccept: application/json\r\ncontent-type: application/json\r\ncontent-length: 88\r\nConnection: close\r\n\r\n',
  329.         _headers: [Object],
  330.         _headerNames: [Object],
  331.         _onPendingData: null,
  332.         agent: [Object],
  333.         socketPath: undefined,
  334.         method: 'POST',
  335.         path: '/1/oauth2/token',
  336.         parser: null,
  337.         res: [Circular] },
  338.      read: [Function],
  339.      _consuming: true,
  340.      _idleNext: null,
  341.      _idlePrev: null,
  342.      _idleTimeout: -1 },
  343.   httpVersionMajor: 1,
  344.   httpVersionMinor: 1,
  345.   httpVersion: '1.1',
  346.   complete: true,
  347.   headers:
  348.    { server: 'nginx',
  349.      date: 'Wed, 27 Jan 2016 13:36:12 GMT',
  350.      'content-type': 'application/json',
  351.      'transfer-encoding': 'chunked',
  352.      connection: 'close',
  353.      'x-dropbox-request-id': '22195df930341e2858563d1c75a33fb4' },
  354.   rawHeaders:
  355.    [ 'Server',
  356.      'nginx',
  357.      'Date',
  358.      'Wed, 27 Jan 2016 13:36:12 GMT',
  359.      'Content-Type',
  360.      'application/json',
  361.      'Transfer-Encoding',
  362.      'chunked',
  363.      'Connection',
  364.      'close',
  365.      'X-Dropbox-Request-Id',
  366.      '22195df930341e2858563d1c75a33fb4' ],
  367.   trailers: {},
  368.   rawTrailers: [],
  369.   upgrade: false,
  370.   url: '',
  371.   method: null,
  372.   statusCode: 400,
  373.   statusMessage: 'Bad Request',
  374.   client:
  375.    TLSSocket {
  376.      _tlsOptions:
  377.       { pipe: null,
  378.         secureContext: [Object],
  379.         isServer: false,
  380.         requestCert: true,
  381.         rejectUnauthorized: true,
  382.         session: undefined,
  383.         NPNProtocols: undefined,
  384.         ALPNProtocols: undefined,
  385.         requestOCSP: undefined },
  386.      _secureEstablished: true,
  387.      _securePending: false,
  388.      _newSessionPending: false,
  389.      _controlReleased: true,
  390.      _SNICallback: null,
  391.      servername: null,
  392.      npnProtocol: false,
  393.      alpnProtocol: false,
  394.      authorized: true,
  395.      authorizationError: null,
  396.      encrypted: true,
  397.      _events:
  398.       { close: [Object],
  399.         end: [Object],
  400.         finish: [Function: onSocketFinish],
  401.         _socketEnd: [Function: onSocketEnd],
  402.         secure: [Function],
  403.         free: [Function: onFree],
  404.         agentRemove: [Function: onRemove],
  405.         drain: [Function: ondrain],
  406.         error: [Object] },
  407.      _eventsCount: 9,
  408.      _connecting: false,
  409.      _hadError: false,
  410.      _handle: null,
  411.      _parent: null,
  412.      _host: 'api.dropboxapi.com',
  413.      _readableState:
  414.       ReadableState {
  415.         objectMode: false,
  416.         highWaterMark: 16384,
  417.         buffer: [],
  418.         length: 0,
  419.         pipes: null,
  420.         pipesCount: 0,
  421.         flowing: true,
  422.         ended: false,
  423.         endEmitted: false,
  424.         reading: true,
  425.         sync: false,
  426.         needReadable: true,
  427.         emittedReadable: false,
  428.         readableListening: false,
  429.         resumeScheduled: false,
  430.         defaultEncoding: 'utf8',
  431.         ranOut: false,
  432.         awaitDrain: 0,
  433.         readingMore: false,
  434.         decoder: null,
  435.         encoding: null },
  436.      readable: false,
  437.      domain: null,
  438.      _maxListeners: 0,
  439.      _writableState:
  440.       WritableState {
  441.         objectMode: false,
  442.         highWaterMark: 16384,
  443.         needDrain: false,
  444.         ending: true,
  445.         ended: true,
  446.         finished: true,
  447.         decodeStrings: false,
  448.         defaultEncoding: 'utf8',
  449.         length: 0,
  450.         writing: false,
  451.         corked: 0,
  452.         sync: false,
  453.         bufferProcessing: false,
  454.         onwrite: [Function],
  455.         writecb: null,
  456.         writelen: 0,
  457.         bufferedRequest: null,
  458.         lastBufferedRequest: null,
  459.         pendingcb: 0,
  460.         prefinished: true,
  461.         errorEmitted: false },
  462.      writable: false,
  463.      allowHalfOpen: false,
  464.      destroyed: true,
  465.      bytesRead: 316,
  466.      _bytesDispatched: 311,
  467.      _sockname: null,
  468.      _pendingData: null,
  469.      _pendingEncoding: '',
  470.      ssl:
  471.       TLSWrap {
  472.         _externalStream: {},
  473.         fd: -22,
  474.         _parent: [Object],
  475.         _parentWrap: undefined,
  476.         _secureContext: [Object],
  477.         reading: true,
  478.         owner: [Circular],
  479.         onread: [Function: noop],
  480.         writeQueueSize: 1,
  481.         onhandshakestart: [Function],
  482.         onhandshakedone: [Function],
  483.         onocspresponse: [Function],
  484.         onerror: [Function] },
  485.      server: undefined,
  486.      _requestCert: true,
  487.      _rejectUnauthorized: true,
  488.      parser: null,
  489.      _httpMessage:
  490.       ClientRequest {
  491.         domain: null,
  492.         _events: [Object],
  493.         _eventsCount: 4,
  494.         _maxListeners: undefined,
  495.         output: [],
  496.         outputEncodings: [],
  497.         outputCallbacks: [],
  498.         outputSize: 0,
  499.         writable: true,
  500.         _last: true,
  501.         chunkedEncoding: false,
  502.         shouldKeepAlive: false,
  503.         useChunkedEncodingByDefault: true,
  504.         sendDate: false,
  505.         _removedHeader: [Object],
  506.         _contentLength: null,
  507.         _hasBody: true,
  508.         _trailer: '',
  509.         finished: true,
  510.         _headerSent: true,
  511.         socket: [Circular],
  512.         connection: [Circular],
  513.         _header: 'POST /1/oauth2/token HTTP/1.1\r\nhost: api.dropboxapi.com\r\nauthorization: Basic M2dlcnl3cnFwa2sxajVqOmd3eDNpOWY1cW03aTg3cg==\r\naccept: application/json\r\ncontent-type: application/json\r\ncontent-length: 88\r\nConnection: close\r\n\r\n',
  514.         _headers: [Object],
  515.         _headerNames: [Object],
  516.         _onPendingData: null,
  517.         agent: [Object],
  518.         socketPath: undefined,
  519.         method: 'POST',
  520.         path: '/1/oauth2/token',
  521.         parser: null,
  522.         res: [Circular] },
  523.      read: [Function],
  524.      _consuming: true,
  525.      _idleNext: null,
  526.      _idlePrev: null,
  527.      _idleTimeout: -1 },
  528.   _consuming: true,
  529.   _dumped: false,
  530.   req:
  531.    ClientRequest {
  532.      domain: null,
  533.      _events:
  534.       { socket: [Object],
  535.         response: [Function: bound ],
  536.         error: [Function: bound ],
  537.         drain: [Function] },
  538.      _eventsCount: 4,
  539.      _maxListeners: undefined,
  540.      output: [],
  541.      outputEncodings: [],
  542.      outputCallbacks: [],
  543.      outputSize: 0,
  544.      writable: true,
  545.      _last: true,
  546.      chunkedEncoding: false,
  547.      shouldKeepAlive: false,
  548.      useChunkedEncodingByDefault: true,
  549.      sendDate: false,
  550.      _removedHeader: { 'content-length': false },
  551.      _contentLength: null,
  552.      _hasBody: true,
  553.      _trailer: '',
  554.      finished: true,
  555.      _headerSent: true,
  556.      socket:
  557.       TLSSocket {
  558.         _tlsOptions: [Object],
  559.         _secureEstablished: true,
  560.         _securePending: false,
  561.         _newSessionPending: false,
  562.         _controlReleased: true,
  563.         _SNICallback: null,
  564.         servername: null,
  565.         npnProtocol: false,
  566.         alpnProtocol: false,
  567.         authorized: true,
  568.         authorizationError: null,
  569.         encrypted: true,
  570.         _events: [Object],
  571.         _eventsCount: 9,
  572.         _connecting: false,
  573.         _hadError: false,
  574.         _handle: null,
  575.         _parent: null,
  576.         _host: 'api.dropboxapi.com',
  577.         _readableState: [Object],
  578.         readable: false,
  579.         domain: null,
  580.         _maxListeners: 0,
  581.         _writableState: [Object],
  582.         writable: false,
  583.         allowHalfOpen: false,
  584.         destroyed: true,
  585.         bytesRead: 316,
  586.         _bytesDispatched: 311,
  587.         _sockname: null,
  588.         _pendingData: null,
  589.         _pendingEncoding: '',
  590.         ssl: [Object],
  591.         server: undefined,
  592.         _requestCert: true,
  593.         _rejectUnauthorized: true,
  594.         parser: null,
  595.         _httpMessage: [Circular],
  596.         read: [Function],
  597.         _consuming: true,
  598.         _idleNext: null,
  599.         _idlePrev: null,
  600.         _idleTimeout: -1 },
  601.      connection:
  602.       TLSSocket {
  603.         _tlsOptions: [Object],
  604.         _secureEstablished: true,
  605.         _securePending: false,
  606.         _newSessionPending: false,
  607.         _controlReleased: true,
  608.         _SNICallback: null,
  609.         servername: null,
  610.         npnProtocol: false,
  611.         alpnProtocol: false,
  612.         authorized: true,
  613.         authorizationError: null,
  614.         encrypted: true,
  615.         _events: [Object],
  616.         _eventsCount: 9,
  617.         _connecting: false,
  618.         _hadError: false,
  619.         _handle: null,
  620.         _parent: null,
  621.         _host: 'api.dropboxapi.com',
  622.         _readableState: [Object],
  623.         readable: false,
  624.         domain: null,
  625.         _maxListeners: 0,
  626.         _writableState: [Object],
  627.         writable: false,
  628.         allowHalfOpen: false,
  629.         destroyed: true,
  630.         bytesRead: 316,
  631.         _bytesDispatched: 311,
  632.         _sockname: null,
  633.         _pendingData: null,
  634.         _pendingEncoding: '',
  635.         ssl: [Object],
  636.         server: undefined,
  637.         _requestCert: true,
  638.         _rejectUnauthorized: true,
  639.         parser: null,
  640.         _httpMessage: [Circular],
  641.         read: [Function],
  642.         _consuming: true,
  643.         _idleNext: null,
  644.         _idlePrev: null,
  645.         _idleTimeout: -1 },
  646.      _header: 'POST /1/oauth2/token HTTP/1.1\r\nhost: api.dropboxapi.com\r\nauthorization: Basic M2dlcnl3cnFwa2sxajVqOmd3eDNpOWY1cW03aTg3cg==\r\naccept: application/json\r\ncontent-type: application/json\r\ncontent-length: 88\r\nConnection: close\r\n\r\n',
  647.      _headers:
  648.       { host: 'api.dropboxapi.com',
  649.         authorization: 'Basic M2dlcnl3cnFwa2sxajVqOmd3eDNpOWY1cW03aTg3cg==',
  650.         accept: 'application/json',
  651.         'content-type': 'application/json',
  652.         'content-length': 88 },
  653.      _headerNames:
  654.       { host: 'host',
  655.         authorization: 'authorization',
  656.         accept: 'accept',
  657.         'content-type': 'content-type',
  658.         'content-length': 'content-length' },
  659.      _onPendingData: null,
  660.      agent:
  661.       Agent {
  662.         domain: null,
  663.         _events: [Object],
  664.         _eventsCount: 1,
  665.         _maxListeners: undefined,
  666.         defaultPort: 443,
  667.         protocol: 'https:',
  668.         options: [Object],
  669.         requests: {},
  670.         sockets: [Object],
  671.         freeSockets: {},
  672.         keepAliveMsecs: 1000,
  673.         keepAlive: false,
  674.         maxSockets: Infinity,
  675.         maxFreeSockets: 256,
  676.         maxCachedSessions: 100,
  677.         _sessionCache: [Object] },
  678.      socketPath: undefined,
  679.      method: 'POST',
  680.      path: '/1/oauth2/token',
  681.      parser: null,
  682.      res: [Circular] },
  683.   request:
  684.    Request {
  685.      domain: null,
  686.      _events:
  687.       { error: [Function: bound ],
  688.         complete: [Function: bound ],
  689.         pipe: [Function],
  690.         end: [Object],
  691.         data: [Function] },
  692.      _eventsCount: 5,
  693.      _maxListeners: undefined,
  694.      callback: [Function],
  695.      method: 'POST',
  696.      readable: true,
  697.      writable: true,
  698.      explicitMethod: true,
  699.      _qs:
  700.       Querystring {
  701.         request: [Circular],
  702.         lib: [Object],
  703.         useQuerystring: undefined,
  704.         parseOptions: {},
  705.         stringifyOptions: {} },
  706.      _auth:
  707.       Auth {
  708.         request: [Circular],
  709.         hasAuth: true,
  710.         sentAuth: true,
  711.         bearerToken: null,
  712.         user: '3gerywrqpkk1j5j',
  713.         pass: '<redacted>' },
  714.      _oauth: OAuth { request: [Circular], params: null },
  715.      _multipart:
  716.       Multipart {
  717.         request: [Circular],
  718.         boundary: 'b5791c28-0cff-49ec-997e-b38b55234e96',
  719.         chunked: false,
  720.         body: null },
  721.      _redirect:
  722.       Redirect {
  723.         request: [Circular],
  724.         followRedirect: true,
  725.         followRedirects: true,
  726.         followAllRedirects: false,
  727.         allowRedirect: [Function],
  728.         maxRedirects: 10,
  729.         redirects: [],
  730.         redirectsFollowed: 0,
  731.         removeRefererHeader: false },
  732.      _tunnel:
  733.       Tunnel {
  734.         request: [Circular],
  735.         proxyHeaderWhiteList: [Object],
  736.         proxyHeaderExclusiveList: [] },
  737.      headers:
  738.       { authorization: 'Basic M2dlcnl3cnFwa2sxajVqOmd3eDNpOWY1cW03aTg3cg==',
  739.         accept: 'application/json',
  740.         'content-type': 'application/json',
  741.         'content-length': 88 },
  742.      setHeader: [Function],
  743.      hasHeader: [Function],
  744.      getHeader: [Function],
  745.      removeHeader: [Function],
  746.      localAddress: undefined,
  747.      pool: {},
  748.      dests: [],
  749.      __isRequestRequest: true,
  750.      _callback: [Function],
  751.      uri:
  752.       Url {
  753.         protocol: 'https:',
  754.         slashes: true,
  755.         auth: null,
  756.         host: 'api.dropboxapi.com',
  757.         port: 443,
  758.         hostname: 'api.dropboxapi.com',
  759.         hash: null,
  760.         search: null,
  761.         query: null,
  762.         pathname: '/1/oauth2/token',
  763.         path: '/1/oauth2/token',
  764.         href: 'https://api.dropboxapi.com/1/oauth2/token' },
  765.      proxy: null,
  766.      tunnel: true,
  767.      setHost: true,
  768.      originalCookieHeader: undefined,
  769.      _disableCookies: true,
  770.      _jar: undefined,
  771.      port: 443,
  772.      host: 'api.dropboxapi.com',
  773.      path: '/1/oauth2/token',
  774.      _json: true,
  775.      body: '{"code":"5k3cYR2ZStUAAAAAAAAH7yEs8pF7XwISiq7fP0s6-i0","grant_type":"authorization_code"}',
  776.      httpModule:
  777.       { Server: [Object],
  778.         createServer: [Function],
  779.         globalAgent: [Object],
  780.         Agent: [Object],
  781.         request: [Function],
  782.         get: [Function] },
  783.      agentClass: { [Function: Agent] super_: [Object] },
  784.      agent:
  785.       Agent {
  786.         domain: null,
  787.         _events: [Object],
  788.         _eventsCount: 1,
  789.         _maxListeners: undefined,
  790.         defaultPort: 443,
  791.         protocol: 'https:',
  792.         options: [Object],
  793.         requests: {},
  794.         sockets: [Object],
  795.         freeSockets: {},
  796.         keepAliveMsecs: 1000,
  797.         keepAlive: false,
  798.         maxSockets: Infinity,
  799.         maxFreeSockets: 256,
  800.         maxCachedSessions: 100,
  801.         _sessionCache: [Object] },
  802.      _started: true,
  803.      href: 'https://api.dropboxapi.com/1/oauth2/token',
  804.      req:
  805.       ClientRequest {
  806.         domain: null,
  807.         _events: [Object],
  808.         _eventsCount: 4,
  809.         _maxListeners: undefined,
  810.         output: [],
  811.         outputEncodings: [],
  812.         outputCallbacks: [],
  813.         outputSize: 0,
  814.         writable: true,
  815.         _last: true,
  816.         chunkedEncoding: false,
  817.         shouldKeepAlive: false,
  818.         useChunkedEncodingByDefault: true,
  819.         sendDate: false,
  820.         _removedHeader: [Object],
  821.         _contentLength: null,
  822.         _hasBody: true,
  823.         _trailer: '',
  824.         finished: true,
  825.         _headerSent: true,
  826.         socket: [Object],
  827.         connection: [Object],
  828.         _header: 'POST /1/oauth2/token HTTP/1.1\r\nhost: api.dropboxapi.com\r\nauthorization: Basic M2dlcnl3cnFwa2sxajVqOmd3eDNpOWY1cW03aTg3cg==\r\naccept: application/json\r\ncontent-type: application/json\r\ncontent-length: 88\r\nConnection: close\r\n\r\n',
  829.         _headers: [Object],
  830.         _headerNames: [Object],
  831.         _onPendingData: null,
  832.         agent: [Object],
  833.         socketPath: undefined,
  834.         method: 'POST',
  835.         path: '/1/oauth2/token',
  836.         parser: null,
  837.         res: [Circular] },
  838.      ntick: true,
  839.      response: [Circular],
  840.      originalHost: 'api.dropboxapi.com',
  841.      originalHostHeaderName: 'host',
  842.      responseContent: [Circular],
  843.      _destdata: true,
  844.      _ended: true,
  845.      _callbackCalled: true },
  846.   toJSON: [Function: responseToJSON],
  847.   caseless:
  848.    Caseless {
  849.      dict:
  850.       { server: 'nginx',
  851.         date: 'Wed, 27 Jan 2016 13:36:12 GMT',
  852.         'content-type': 'application/json',
  853.         'transfer-encoding': 'chunked',
  854.         connection: 'close',
  855.         'x-dropbox-request-id': '22195df930341e2858563d1c75a33fb4' } },
  856.   read: [Function],
  857.   body:
  858.    { error_description: 'missing required field "grant_type"',
  859.      error: 'invalid_request' } }
  860. body:  { error_description: 'missing required field "grant_type"',
  861.   error: 'invalid_request' }
  862.  
  863.  
  864.  
  865. $ node getTokenPost.js
  866. resp:  IncomingMessage {
  867.   _readableState:
  868.    ReadableState {
  869.      objectMode: false,
  870.      highWaterMark: 16384,
  871.      buffer: [],
  872.      length: 0,
  873.      pipes: null,
  874.      pipesCount: 0,
  875.      flowing: true,
  876.      ended: true,
  877.      endEmitted: true,
  878.      reading: false,
  879.      sync: true,
  880.      needReadable: false,
  881.      emittedReadable: false,
  882.      readableListening: false,
  883.      resumeScheduled: false,
  884.      defaultEncoding: 'utf8',
  885.      ranOut: false,
  886.      awaitDrain: 0,
  887.      readingMore: false,
  888.      decoder: null,
  889.      encoding: null },
  890.   readable: false,
  891.   domain: null,
  892.   _events:
  893.    { end: [ [Function: responseOnEnd], [Function], [Function], [Function] ],
  894.      close: [ [Function], [Function] ],
  895.      data: [Function],
  896.      error: [Function] },
  897.   _eventsCount: 4,
  898.   _maxListeners: undefined,
  899.   socket:
  900.    TLSSocket {
  901.      _tlsOptions:
  902.       { pipe: null,
  903.         secureContext: [Object],
  904.         isServer: false,
  905.         requestCert: true,
  906.         rejectUnauthorized: true,
  907.         session: undefined,
  908.         NPNProtocols: undefined,
  909.         ALPNProtocols: undefined,
  910.         requestOCSP: undefined },
  911.      _secureEstablished: true,
  912.      _securePending: false,
  913.      _newSessionPending: false,
  914.      _controlReleased: true,
  915.      _SNICallback: null,
  916.      servername: null,
  917.      npnProtocol: false,
  918.      alpnProtocol: false,
  919.      authorized: true,
  920.      authorizationError: null,
  921.      encrypted: true,
  922.      _events:
  923.       { close: [Object],
  924.         end: [Object],
  925.         finish: [Function: onSocketFinish],
  926.         _socketEnd: [Function: onSocketEnd],
  927.         secure: [Function],
  928.         free: [Function: onFree],
  929.         agentRemove: [Function: onRemove],
  930.         drain: [Function: ondrain],
  931.         error: [Object] },
  932.      _eventsCount: 9,
  933.      _connecting: false,
  934.      _hadError: false,
  935.      _handle: null,
  936.      _parent: null,
  937.      _host: 'api.dropboxapi.com',
  938.      _readableState:
  939.       ReadableState {
  940.         objectMode: false,
  941.         highWaterMark: 16384,
  942.         buffer: [],
  943.         length: 0,
  944.         pipes: null,
  945.         pipesCount: 0,
  946.         flowing: true,
  947.         ended: false,
  948.         endEmitted: false,
  949.         reading: true,
  950.         sync: false,
  951.         needReadable: true,
  952.         emittedReadable: false,
  953.         readableListening: false,
  954.         resumeScheduled: false,
  955.         defaultEncoding: 'utf8',
  956.         ranOut: false,
  957.         awaitDrain: 0,
  958.         readingMore: false,
  959.         decoder: null,
  960.         encoding: null },
  961.      readable: false,
  962.      domain: null,
  963.      _maxListeners: 0,
  964.      _writableState:
  965.       WritableState {
  966.         objectMode: false,
  967.         highWaterMark: 16384,
  968.         needDrain: false,
  969.         ending: true,
  970.         ended: true,
  971.         finished: true,
  972.         decodeStrings: false,
  973.         defaultEncoding: 'utf8',
  974.         length: 0,
  975.         writing: false,
  976.         corked: 0,
  977.         sync: false,
  978.         bufferProcessing: false,
  979.         onwrite: [Function],
  980.         writecb: null,
  981.         writelen: 0,
  982.         bufferedRequest: null,
  983.         lastBufferedRequest: null,
  984.         pendingcb: 0,
  985.         prefinished: true,
  986.         errorEmitted: false },
  987.      writable: false,
  988.      allowHalfOpen: false,
  989.      destroyed: true,
  990.      bytesRead: 323,
  991.      _bytesDispatched: 309,
  992.      _sockname: null,
  993.      _pendingData: null,
  994.      _pendingEncoding: '',
  995.      ssl:
  996.       TLSWrap {
  997.         _externalStream: {},
  998.         fd: -22,
  999.         _parent: [Object],
  1000.         _parentWrap: undefined,
  1001.         _secureContext: [Object],
  1002.         reading: true,
  1003.         owner: [Circular],
  1004.         onread: [Function: noop],
  1005.         writeQueueSize: 1,
  1006.         onhandshakestart: [Function],
  1007.         onhandshakedone: [Function],
  1008.         onocspresponse: [Function],
  1009.         onerror: [Function] },
  1010.      server: undefined,
  1011.      _requestCert: true,
  1012.      _rejectUnauthorized: true,
  1013.      parser: null,
  1014.      _httpMessage:
  1015.       ClientRequest {
  1016.         domain: null,
  1017.         _events: [Object],
  1018.         _eventsCount: 4,
  1019.         _maxListeners: undefined,
  1020.         output: [],
  1021.         outputEncodings: [],
  1022.         outputCallbacks: [],
  1023.         outputSize: 0,
  1024.         writable: true,
  1025.         _last: true,
  1026.         chunkedEncoding: false,
  1027.         shouldKeepAlive: false,
  1028.         useChunkedEncodingByDefault: true,
  1029.         sendDate: false,
  1030.         _removedHeader: [Object],
  1031.         _contentLength: null,
  1032.         _hasBody: true,
  1033.         _trailer: '',
  1034.         finished: true,
  1035.         _headerSent: true,
  1036.         socket: [Circular],
  1037.         connection: [Circular],
  1038.         _header: 'POST /1/oauth2/token HTTP/1.1\r\nhost: api.dropboxapi.com\r\naccept: application/json\r\ncontent-type: application/json\r\ncontent-length: 152\r\nConnection: close\r\n\r\n',
  1039.         _headers: [Object],
  1040.         _headerNames: [Object],
  1041.         _onPendingData: null,
  1042.         agent: [Object],
  1043.         socketPath: undefined,
  1044.         method: 'POST',
  1045.         path: '/1/oauth2/token',
  1046.         parser: null,
  1047.         res: [Circular] },
  1048.      read: [Function],
  1049.      _consuming: true,
  1050.      _idleNext: null,
  1051.      _idlePrev: null,
  1052.      _idleTimeout: -1 },
  1053.   connection:
  1054.    TLSSocket {
  1055.      _tlsOptions:
  1056.       { pipe: null,
  1057.         secureContext: [Object],
  1058.         isServer: false,
  1059.         requestCert: true,
  1060.         rejectUnauthorized: true,
  1061.         session: undefined,
  1062.         NPNProtocols: undefined,
  1063.         ALPNProtocols: undefined,
  1064.         requestOCSP: undefined },
  1065.      _secureEstablished: true,
  1066.      _securePending: false,
  1067.      _newSessionPending: false,
  1068.      _controlReleased: true,
  1069.      _SNICallback: null,
  1070.      servername: null,
  1071.      npnProtocol: false,
  1072.      alpnProtocol: false,
  1073.      authorized: true,
  1074.      authorizationError: null,
  1075.      encrypted: true,
  1076.      _events:
  1077.       { close: [Object],
  1078.         end: [Object],
  1079.         finish: [Function: onSocketFinish],
  1080.         _socketEnd: [Function: onSocketEnd],
  1081.         secure: [Function],
  1082.         free: [Function: onFree],
  1083.         agentRemove: [Function: onRemove],
  1084.         drain: [Function: ondrain],
  1085.         error: [Object] },
  1086.      _eventsCount: 9,
  1087.      _connecting: false,
  1088.      _hadError: false,
  1089.      _handle: null,
  1090.      _parent: null,
  1091.      _host: 'api.dropboxapi.com',
  1092.      _readableState:
  1093.       ReadableState {
  1094.         objectMode: false,
  1095.         highWaterMark: 16384,
  1096.         buffer: [],
  1097.         length: 0,
  1098.         pipes: null,
  1099.         pipesCount: 0,
  1100.         flowing: true,
  1101.         ended: false,
  1102.         endEmitted: false,
  1103.         reading: true,
  1104.         sync: false,
  1105.         needReadable: true,
  1106.         emittedReadable: false,
  1107.         readableListening: false,
  1108.         resumeScheduled: false,
  1109.         defaultEncoding: 'utf8',
  1110.         ranOut: false,
  1111.         awaitDrain: 0,
  1112.         readingMore: false,
  1113.         decoder: null,
  1114.         encoding: null },
  1115.      readable: false,
  1116.      domain: null,
  1117.      _maxListeners: 0,
  1118.      _writableState:
  1119.       WritableState {
  1120.         objectMode: false,
  1121.         highWaterMark: 16384,
  1122.         needDrain: false,
  1123.         ending: true,
  1124.         ended: true,
  1125.         finished: true,
  1126.         decodeStrings: false,
  1127.         defaultEncoding: 'utf8',
  1128.         length: 0,
  1129.         writing: false,
  1130.         corked: 0,
  1131.         sync: false,
  1132.         bufferProcessing: false,
  1133.         onwrite: [Function],
  1134.         writecb: null,
  1135.         writelen: 0,
  1136.         bufferedRequest: null,
  1137.         lastBufferedRequest: null,
  1138.         pendingcb: 0,
  1139.         prefinished: true,
  1140.         errorEmitted: false },
  1141.      writable: false,
  1142.      allowHalfOpen: false,
  1143.      destroyed: true,
  1144.      bytesRead: 323,
  1145.      _bytesDispatched: 309,
  1146.      _sockname: null,
  1147.      _pendingData: null,
  1148.      _pendingEncoding: '',
  1149.      ssl:
  1150.       TLSWrap {
  1151.         _externalStream: {},
  1152.         fd: -22,
  1153.         _parent: [Object],
  1154.         _parentWrap: undefined,
  1155.         _secureContext: [Object],
  1156.         reading: true,
  1157.         owner: [Circular],
  1158.         onread: [Function: noop],
  1159.         writeQueueSize: 1,
  1160.         onhandshakestart: [Function],
  1161.         onhandshakedone: [Function],
  1162.         onocspresponse: [Function],
  1163.         onerror: [Function] },
  1164.      server: undefined,
  1165.      _requestCert: true,
  1166.      _rejectUnauthorized: true,
  1167.      parser: null,
  1168.      _httpMessage:
  1169.       ClientRequest {
  1170.         domain: null,
  1171.         _events: [Object],
  1172.         _eventsCount: 4,
  1173.         _maxListeners: undefined,
  1174.         output: [],
  1175.         outputEncodings: [],
  1176.         outputCallbacks: [],
  1177.         outputSize: 0,
  1178.         writable: true,
  1179.         _last: true,
  1180.         chunkedEncoding: false,
  1181.         shouldKeepAlive: false,
  1182.         useChunkedEncodingByDefault: true,
  1183.         sendDate: false,
  1184.         _removedHeader: [Object],
  1185.         _contentLength: null,
  1186.         _hasBody: true,
  1187.         _trailer: '',
  1188.         finished: true,
  1189.         _headerSent: true,
  1190.         socket: [Circular],
  1191.         connection: [Circular],
  1192.         _header: 'POST /1/oauth2/token HTTP/1.1\r\nhost: api.dropboxapi.com\r\naccept: application/json\r\ncontent-type: application/json\r\ncontent-length: 152\r\nConnection: close\r\n\r\n',
  1193.         _headers: [Object],
  1194.         _headerNames: [Object],
  1195.         _onPendingData: null,
  1196.         agent: [Object],
  1197.         socketPath: undefined,
  1198.         method: 'POST',
  1199.         path: '/1/oauth2/token',
  1200.         parser: null,
  1201.         res: [Circular] },
  1202.      read: [Function],
  1203.      _consuming: true,
  1204.      _idleNext: null,
  1205.      _idlePrev: null,
  1206.      _idleTimeout: -1 },
  1207.   httpVersionMajor: 1,
  1208.   httpVersionMinor: 1,
  1209.   httpVersion: '1.1',
  1210.   complete: true,
  1211.   headers:
  1212.    { server: 'nginx',
  1213.      date: 'Wed, 27 Jan 2016 13:34:02 GMT',
  1214.      'content-type': 'application/json',
  1215.      'transfer-encoding': 'chunked',
  1216.      connection: 'close',
  1217.      'x-dropbox-request-id': 'c6f65265cf4d605b83a903b9dbe0d719' },
  1218.   rawHeaders:
  1219.    [ 'Server',
  1220.      'nginx',
  1221.      'Date',
  1222.      'Wed, 27 Jan 2016 13:34:02 GMT',
  1223.      'Content-Type',
  1224.      'application/json',
  1225.      'Transfer-Encoding',
  1226.      'chunked',
  1227.      'Connection',
  1228.      'close',
  1229.      'X-Dropbox-Request-Id',
  1230.      'c6f65265cf4d605b83a903b9dbe0d719' ],
  1231.   trailers: {},
  1232.   rawTrailers: [],
  1233.   upgrade: false,
  1234.   url: '',
  1235.   method: null,
  1236.   statusCode: 400,
  1237.   statusMessage: 'Bad Request',
  1238.   client:
  1239.    TLSSocket {
  1240.      _tlsOptions:
  1241.       { pipe: null,
  1242.         secureContext: [Object],
  1243.         isServer: false,
  1244.         requestCert: true,
  1245.         rejectUnauthorized: true,
  1246.         session: undefined,
  1247.         NPNProtocols: undefined,
  1248.         ALPNProtocols: undefined,
  1249.         requestOCSP: undefined },
  1250.      _secureEstablished: true,
  1251.      _securePending: false,
  1252.      _newSessionPending: false,
  1253.      _controlReleased: true,
  1254.      _SNICallback: null,
  1255.      servername: null,
  1256.      npnProtocol: false,
  1257.      alpnProtocol: false,
  1258.      authorized: true,
  1259.      authorizationError: null,
  1260.      encrypted: true,
  1261.      _events:
  1262.       { close: [Object],
  1263.         end: [Object],
  1264.         finish: [Function: onSocketFinish],
  1265.         _socketEnd: [Function: onSocketEnd],
  1266.         secure: [Function],
  1267.         free: [Function: onFree],
  1268.         agentRemove: [Function: onRemove],
  1269.         drain: [Function: ondrain],
  1270.         error: [Object] },
  1271.      _eventsCount: 9,
  1272.      _connecting: false,
  1273.      _hadError: false,
  1274.      _handle: null,
  1275.      _parent: null,
  1276.      _host: 'api.dropboxapi.com',
  1277.      _readableState:
  1278.       ReadableState {
  1279.         objectMode: false,
  1280.         highWaterMark: 16384,
  1281.         buffer: [],
  1282.         length: 0,
  1283.         pipes: null,
  1284.         pipesCount: 0,
  1285.         flowing: true,
  1286.         ended: false,
  1287.         endEmitted: false,
  1288.         reading: true,
  1289.         sync: false,
  1290.         needReadable: true,
  1291.         emittedReadable: false,
  1292.         readableListening: false,
  1293.         resumeScheduled: false,
  1294.         defaultEncoding: 'utf8',
  1295.         ranOut: false,
  1296.         awaitDrain: 0,
  1297.         readingMore: false,
  1298.         decoder: null,
  1299.         encoding: null },
  1300.      readable: false,
  1301.      domain: null,
  1302.      _maxListeners: 0,
  1303.      _writableState:
  1304.       WritableState {
  1305.         objectMode: false,
  1306.         highWaterMark: 16384,
  1307.         needDrain: false,
  1308.         ending: true,
  1309.         ended: true,
  1310.         finished: true,
  1311.         decodeStrings: false,
  1312.         defaultEncoding: 'utf8',
  1313.         length: 0,
  1314.         writing: false,
  1315.         corked: 0,
  1316.         sync: false,
  1317.         bufferProcessing: false,
  1318.         onwrite: [Function],
  1319.         writecb: null,
  1320.         writelen: 0,
  1321.         bufferedRequest: null,
  1322.         lastBufferedRequest: null,
  1323.         pendingcb: 0,
  1324.         prefinished: true,
  1325.         errorEmitted: false },
  1326.      writable: false,
  1327.      allowHalfOpen: false,
  1328.      destroyed: true,
  1329.      bytesRead: 323,
  1330.      _bytesDispatched: 309,
  1331.      _sockname: null,
  1332.      _pendingData: null,
  1333.      _pendingEncoding: '',
  1334.      ssl:
  1335.       TLSWrap {
  1336.         _externalStream: {},
  1337.         fd: -22,
  1338.         _parent: [Object],
  1339.         _parentWrap: undefined,
  1340.         _secureContext: [Object],
  1341.         reading: true,
  1342.         owner: [Circular],
  1343.         onread: [Function: noop],
  1344.         writeQueueSize: 1,
  1345.         onhandshakestart: [Function],
  1346.         onhandshakedone: [Function],
  1347.         onocspresponse: [Function],
  1348.         onerror: [Function] },
  1349.      server: undefined,
  1350.      _requestCert: true,
  1351.      _rejectUnauthorized: true,
  1352.      parser: null,
  1353.      _httpMessage:
  1354.       ClientRequest {
  1355.         domain: null,
  1356.         _events: [Object],
  1357.         _eventsCount: 4,
  1358.         _maxListeners: undefined,
  1359.         output: [],
  1360.         outputEncodings: [],
  1361.         outputCallbacks: [],
  1362.         outputSize: 0,
  1363.         writable: true,
  1364.         _last: true,
  1365.         chunkedEncoding: false,
  1366.         shouldKeepAlive: false,
  1367.         useChunkedEncodingByDefault: true,
  1368.         sendDate: false,
  1369.         _removedHeader: [Object],
  1370.         _contentLength: null,
  1371.         _hasBody: true,
  1372.         _trailer: '',
  1373.         finished: true,
  1374.         _headerSent: true,
  1375.         socket: [Circular],
  1376.         connection: [Circular],
  1377.         _header: 'POST /1/oauth2/token HTTP/1.1\r\nhost: api.dropboxapi.com\r\naccept: application/json\r\ncontent-type: application/json\r\ncontent-length: 152\r\nConnection: close\r\n\r\n',
  1378.         _headers: [Object],
  1379.         _headerNames: [Object],
  1380.         _onPendingData: null,
  1381.         agent: [Object],
  1382.         socketPath: undefined,
  1383.         method: 'POST',
  1384.         path: '/1/oauth2/token',
  1385.         parser: null,
  1386.         res: [Circular] },
  1387.      read: [Function],
  1388.      _consuming: true,
  1389.      _idleNext: null,
  1390.      _idlePrev: null,
  1391.      _idleTimeout: -1 },
  1392.   _consuming: true,
  1393.   _dumped: false,
  1394.   req:
  1395.    ClientRequest {
  1396.      domain: null,
  1397.      _events:
  1398.       { socket: [Object],
  1399.         response: [Function: bound ],
  1400.         error: [Function: bound ],
  1401.         drain: [Function] },
  1402.      _eventsCount: 4,
  1403.      _maxListeners: undefined,
  1404.      output: [],
  1405.      outputEncodings: [],
  1406.      outputCallbacks: [],
  1407.      outputSize: 0,
  1408.      writable: true,
  1409.      _last: true,
  1410.      chunkedEncoding: false,
  1411.      shouldKeepAlive: false,
  1412.      useChunkedEncodingByDefault: true,
  1413.      sendDate: false,
  1414.      _removedHeader: { 'content-length': false },
  1415.      _contentLength: null,
  1416.      _hasBody: true,
  1417.      _trailer: '',
  1418.      finished: true,
  1419.      _headerSent: true,
  1420.      socket:
  1421.       TLSSocket {
  1422.         _tlsOptions: [Object],
  1423.         _secureEstablished: true,
  1424.         _securePending: false,
  1425.         _newSessionPending: false,
  1426.         _controlReleased: true,
  1427.         _SNICallback: null,
  1428.         servername: null,
  1429.         npnProtocol: false,
  1430.         alpnProtocol: false,
  1431.         authorized: true,
  1432.         authorizationError: null,
  1433.         encrypted: true,
  1434.         _events: [Object],
  1435.         _eventsCount: 9,
  1436.         _connecting: false,
  1437.         _hadError: false,
  1438.         _handle: null,
  1439.         _parent: null,
  1440.         _host: 'api.dropboxapi.com',
  1441.         _readableState: [Object],
  1442.         readable: false,
  1443.         domain: null,
  1444.         _maxListeners: 0,
  1445.         _writableState: [Object],
  1446.         writable: false,
  1447.         allowHalfOpen: false,
  1448.         destroyed: true,
  1449.         bytesRead: 323,
  1450.         _bytesDispatched: 309,
  1451.         _sockname: null,
  1452.         _pendingData: null,
  1453.         _pendingEncoding: '',
  1454.         ssl: [Object],
  1455.         server: undefined,
  1456.         _requestCert: true,
  1457.         _rejectUnauthorized: true,
  1458.         parser: null,
  1459.         _httpMessage: [Circular],
  1460.         read: [Function],
  1461.         _consuming: true,
  1462.         _idleNext: null,
  1463.         _idlePrev: null,
  1464.         _idleTimeout: -1 },
  1465.      connection:
  1466.       TLSSocket {
  1467.         _tlsOptions: [Object],
  1468.         _secureEstablished: true,
  1469.         _securePending: false,
  1470.         _newSessionPending: false,
  1471.         _controlReleased: true,
  1472.         _SNICallback: null,
  1473.         servername: null,
  1474.         npnProtocol: false,
  1475.         alpnProtocol: false,
  1476.         authorized: true,
  1477.         authorizationError: null,
  1478.         encrypted: true,
  1479.         _events: [Object],
  1480.         _eventsCount: 9,
  1481.         _connecting: false,
  1482.         _hadError: false,
  1483.         _handle: null,
  1484.         _parent: null,
  1485.         _host: 'api.dropboxapi.com',
  1486.         _readableState: [Object],
  1487.         readable: false,
  1488.         domain: null,
  1489.         _maxListeners: 0,
  1490.         _writableState: [Object],
  1491.         writable: false,
  1492.         allowHalfOpen: false,
  1493.         destroyed: true,
  1494.         bytesRead: 323,
  1495.         _bytesDispatched: 309,
  1496.         _sockname: null,
  1497.         _pendingData: null,
  1498.         _pendingEncoding: '',
  1499.         ssl: [Object],
  1500.         server: undefined,
  1501.         _requestCert: true,
  1502.         _rejectUnauthorized: true,
  1503.         parser: null,
  1504.         _httpMessage: [Circular],
  1505.         read: [Function],
  1506.         _consuming: true,
  1507.         _idleNext: null,
  1508.         _idlePrev: null,
  1509.         _idleTimeout: -1 },
  1510.      _header: 'POST /1/oauth2/token HTTP/1.1\r\nhost: api.dropboxapi.com\r\naccept: application/json\r\ncontent-type: application/json\r\ncontent-length: 152\r\nConnection: close\r\n\r\n',
  1511.      _headers:
  1512.       { host: 'api.dropboxapi.com',
  1513.         accept: 'application/json',
  1514.         'content-type': 'application/json',
  1515.         'content-length': 152 },
  1516.      _headerNames:
  1517.       { host: 'host',
  1518.         accept: 'accept',
  1519.         'content-type': 'content-type',
  1520.         'content-length': 'content-length' },
  1521.      _onPendingData: null,
  1522.      agent:
  1523.       Agent {
  1524.         domain: null,
  1525.         _events: [Object],
  1526.         _eventsCount: 1,
  1527.         _maxListeners: undefined,
  1528.         defaultPort: 443,
  1529.         protocol: 'https:',
  1530.         options: [Object],
  1531.         requests: {},
  1532.         sockets: [Object],
  1533.         freeSockets: {},
  1534.         keepAliveMsecs: 1000,
  1535.         keepAlive: false,
  1536.         maxSockets: Infinity,
  1537.         maxFreeSockets: 256,
  1538.         maxCachedSessions: 100,
  1539.         _sessionCache: [Object] },
  1540.      socketPath: undefined,
  1541.      method: 'POST',
  1542.      path: '/1/oauth2/token',
  1543.      parser: null,
  1544.      res: [Circular] },
  1545.   request:
  1546.    Request {
  1547.      domain: null,
  1548.      _events:
  1549.       { error: [Function: bound ],
  1550.         complete: [Function: bound ],
  1551.         pipe: [Function],
  1552.         end: [Object],
  1553.         data: [Function] },
  1554.      _eventsCount: 5,
  1555.      _maxListeners: undefined,
  1556.      callback: [Function],
  1557.      method: 'POST',
  1558.      readable: true,
  1559.      writable: true,
  1560.      explicitMethod: true,
  1561.      _qs:
  1562.       Querystring {
  1563.         request: [Circular],
  1564.         lib: [Object],
  1565.         useQuerystring: undefined,
  1566.         parseOptions: {},
  1567.         stringifyOptions: {} },
  1568.      _auth:
  1569.       Auth {
  1570.         request: [Circular],
  1571.         hasAuth: false,
  1572.         sentAuth: false,
  1573.         bearerToken: null,
  1574.         user: null,
  1575.         pass: null },
  1576.      _oauth: OAuth { request: [Circular], params: null },
  1577.      _multipart:
  1578.       Multipart {
  1579.         request: [Circular],
  1580.         boundary: '7d98b264-65ef-4917-9f14-80f876f64be1',
  1581.         chunked: false,
  1582.         body: null },
  1583.      _redirect:
  1584.       Redirect {
  1585.         request: [Circular],
  1586.         followRedirect: true,
  1587.         followRedirects: true,
  1588.         followAllRedirects: false,
  1589.         allowRedirect: [Function],
  1590.         maxRedirects: 10,
  1591.         redirects: [],
  1592.         redirectsFollowed: 0,
  1593.         removeRefererHeader: false },
  1594.      _tunnel:
  1595.       Tunnel {
  1596.         request: [Circular],
  1597.         proxyHeaderWhiteList: [Object],
  1598.         proxyHeaderExclusiveList: [] },
  1599.      headers:
  1600.       { accept: 'application/json',
  1601.         'content-type': 'application/json',
  1602.         'content-length': 152 },
  1603.      setHeader: [Function],
  1604.      hasHeader: [Function],
  1605.      getHeader: [Function],
  1606.      removeHeader: [Function],
  1607.      localAddress: undefined,
  1608.      pool: {},
  1609.      dests: [],
  1610.      __isRequestRequest: true,
  1611.      _callback: [Function],
  1612.      uri:
  1613.       Url {
  1614.         protocol: 'https:',
  1615.         slashes: true,
  1616.         auth: null,
  1617.         host: 'api.dropboxapi.com',
  1618.         port: 443,
  1619.         hostname: 'api.dropboxapi.com',
  1620.         hash: null,
  1621.         search: null,
  1622.         query: null,
  1623.         pathname: '/1/oauth2/token',
  1624.         path: '/1/oauth2/token',
  1625.         href: 'https://api.dropboxapi.com/1/oauth2/token' },
  1626.      proxy: null,
  1627.      tunnel: true,
  1628.      setHost: true,
  1629.      originalCookieHeader: undefined,
  1630.      _disableCookies: true,
  1631.      _jar: undefined,
  1632.      port: 443,
  1633.      host: 'api.dropboxapi.com',
  1634.      path: '/1/oauth2/token',
  1635.      _json: true,
  1636.      body: '{"code":"5k3cYR2ZStUAAAAAAAAH7yEs8pF7XwISiq7fP0s6-i0","grant_type":"authorization_code","client_id":"3gerywrqpkk1j5j","client_secret":"<redacted>"}',
  1637.      httpModule:
  1638.       { Server: [Object],
  1639.         createServer: [Function],
  1640.         globalAgent: [Object],
  1641.         Agent: [Object],
  1642.         request: [Function],
  1643.         get: [Function] },
  1644.      agentClass: { [Function: Agent] super_: [Object] },
  1645.      agent:
  1646.       Agent {
  1647.         domain: null,
  1648.         _events: [Object],
  1649.         _eventsCount: 1,
  1650.         _maxListeners: undefined,
  1651.         defaultPort: 443,
  1652.         protocol: 'https:',
  1653.         options: [Object],
  1654.         requests: {},
  1655.         sockets: [Object],
  1656.         freeSockets: {},
  1657.         keepAliveMsecs: 1000,
  1658.         keepAlive: false,
  1659.         maxSockets: Infinity,
  1660.         maxFreeSockets: 256,
  1661.         maxCachedSessions: 100,
  1662.         _sessionCache: [Object] },
  1663.      _started: true,
  1664.      href: 'https://api.dropboxapi.com/1/oauth2/token',
  1665.      req:
  1666.       ClientRequest {
  1667.         domain: null,
  1668.         _events: [Object],
  1669.         _eventsCount: 4,
  1670.         _maxListeners: undefined,
  1671.         output: [],
  1672.         outputEncodings: [],
  1673.         outputCallbacks: [],
  1674.         outputSize: 0,
  1675.         writable: true,
  1676.         _last: true,
  1677.         chunkedEncoding: false,
  1678.         shouldKeepAlive: false,
  1679.         useChunkedEncodingByDefault: true,
  1680.         sendDate: false,
  1681.         _removedHeader: [Object],
  1682.         _contentLength: null,
  1683.         _hasBody: true,
  1684.         _trailer: '',
  1685.         finished: true,
  1686.         _headerSent: true,
  1687.         socket: [Object],
  1688.         connection: [Object],
  1689.         _header: 'POST /1/oauth2/token HTTP/1.1\r\nhost: api.dropboxapi.com\r\naccept: application/json\r\ncontent-type: application/json\r\ncontent-length: 152\r\nConnection: close\r\n\r\n',
  1690.         _headers: [Object],
  1691.         _headerNames: [Object],
  1692.         _onPendingData: null,
  1693.         agent: [Object],
  1694.         socketPath: undefined,
  1695.         method: 'POST',
  1696.         path: '/1/oauth2/token',
  1697.         parser: null,
  1698.         res: [Circular] },
  1699.      ntick: true,
  1700.      response: [Circular],
  1701.      originalHost: 'api.dropboxapi.com',
  1702.      originalHostHeaderName: 'host',
  1703.      responseContent: [Circular],
  1704.      _destdata: true,
  1705.      _ended: true,
  1706.      _callbackCalled: true },
  1707.   toJSON: [Function: responseToJSON],
  1708.   caseless:
  1709.    Caseless {
  1710.      dict:
  1711.       { server: 'nginx',
  1712.         date: 'Wed, 27 Jan 2016 13:34:02 GMT',
  1713.         'content-type': 'application/json',
  1714.         'transfer-encoding': 'chunked',
  1715.         connection: 'close',
  1716.         'x-dropbox-request-id': 'c6f65265cf4d605b83a903b9dbe0d719' } },
  1717.   read: [Function],
  1718.   body:
  1719.    { error_description: 'No auth function available for given request',
  1720.      error: 'invalid_request' } }
  1721. body:  { error_description: 'No auth function available for given request',
  1722.   error: 'invalid_request' }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement