Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updateBooking return error Invalid URL format #66

Open
SET001 opened this issue Apr 27, 2020 · 0 comments
Open

updateBooking return error Invalid URL format #66

SET001 opened this issue Apr 27, 2020 · 0 comments

Comments

@SET001
Copy link

SET001 commented Apr 27, 2020

the code is as simple as this:

await Timekit.sdk.updateBooking({id: id, action: action});

the data passed is:

{
  "id": "41ca328e-7cd1-48d9-a5b2-a822a6899b3c",
  "action": "confirm"
} 

and in I'm getting response with statusMessage: 'Unprocessable Entity', and data: { error: 'Index 1: url: Invalid URL format, ' }

here is full response object:

{
  status: 422,
  statusText: 'Unprocessable Entity',
  headers: {
    server: 'nginx/1.9.13',
    'content-type': 'application/json',
    'transfer-encoding': 'chunked',
    connection: 'close',
    'cache-control': 'no-cache',
    vary: 'Origin',
    'x-ratelimit-remaining': '806',
    'timekit-testmode': 'true',
    'access-control-expose-headers': 'Timekit-TestMode',
    'timekit-request-id': 'd37d74e7-5a37-44e0-bf3e-87c4c28c721c',
    date: 'Mon, 27 Apr 2020 07:17:19 GMT',
    'set-cookie': [
      'laravel_session=sUd7O6IqeHQSQRaiPRJO5OcVHmR66ZjCwHz5Werl; expires=Mon, 27-Apr-2020 09:17:19 GMT; Max-Age=7200; path=/; HttpOnly'
    ]
  },
  config: {
    transformRequest: { '0': [Function: transformRequest] },
    transformResponse: { '0': [Function: transformResponse] },
    headers: {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json;charset=utf-8',
      Authorization: 'Basic OnRlc3RfYXBpX2tleV9oUnE4bjBEVWxENnhLeWtUNlR1djc3dTltbVRpUUdOMA==',
      'User-Agent': 'axios/0.12.0',
      'Content-Length': 2
    },
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    validateStatus: [Function: validateStatus],
    method: 'put',
    url: 'https://api.timekit.io/v2/bookings/41ca328e-7cd1-48d9-a5b2-a822a6899b3c/confirm',
    data: '{}',
    withCredentials: undefined
  },
  request: <ref *1> ClientRequest {
    _events: [Object: null prototype] {
      error: [Function: handleRequestError],
      prefinish: [Function: requestOnPrefinish]
    },
    _eventsCount: 2,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    useChunkedEncodingByDefault: true,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: 2,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    socket: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      _SNICallback: null,
      servername: 'api.timekit.io',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'api.timekit.io',
      _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 *1],
      [Symbol(res)]: [TLSWrap],
      [Symbol(asyncId)]: 5896,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(kSetNoDelay)]: false,
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object]
    },
    _header: 'PUT /v2/bookings/41ca328e-7cd1-48d9-a5b2-a822a6899b3c/confirm HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'Content-Type: application/json;charset=utf-8\r\n' +
      'Authorization: Basic OnRlc3RfYXBpX2tleV9oUnE4bjBEVWxENnhLeWtUNlR1djc3dTltbVRpUUdOMA==\r\n' +
      'User-Agent: axios/0.12.0\r\n' +
      'Content-Length: 2\r\n' +
      'Host: api.timekit.io\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _onPendingData: [Function: noopPendingOutput],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 443,
      protocol: 'https:',
      options: [Object],
      requests: {},
      sockets: [Object],
      freeSockets: {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      maxCachedSessions: 100,
      _sessionCache: [Object],
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'PUT',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    path: '/v2/bookings/41ca328e-7cd1-48d9-a5b2-a822a6899b3c/confirm',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      readable: false,
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      socket: [TLSSocket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      headers: [Object],
      rawHeaders: [Array],
      trailers: {},
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 422,
      statusMessage: 'Unprocessable Entity',
      client: [TLSSocket],
      _consuming: false,
      _dumped: false,
      req: [Circular *1],
      fetchedUrls: [Array],
      [Symbol(kCapture)]: false
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    [Symbol(kCapture)]: false,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      'content-type': [Array],
      authorization: [Array],
      'user-agent': [Array],
      'content-length': [Array],
      host: [Array]
    }
  },
  data: { error: 'Index 1: url: Invalid URL format, ' }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant