create-client icon indicating copy to clipboard operation
create-client copied to clipboard

Error 406 : Not acceptable

Open BenWaNH opened this issue 6 years ago • 2 comments

Hi,

i've an error 406 Not Acceptable when i try this command : generate-api-platform-client -g vue http://my-project.local/api src/

This is my response :

{ api:
   Api { entrypoint: 'http://my-project.local/api', resources: [] },
  error:
   { response:
      Body {
        url: 'http://my-project.local/api',
        status: 406,
        statusText: 'Not Acceptable',
        headers: [Headers],
        ok: false,
        body: [PassThrough],
        bodyUsed: false,
        size: 0,
        timeout: 0,
        _raw: [],
        _abort: false } },
  response:
   Body {
     url: 'http://my-project.local/api',
     status: 406,
     statusText: 'Not Acceptable',
     headers: Headers { _headers: [Object] },
     ok: false,
     body:
      PassThrough {
        _readableState: [ReadableState],
        readable: true,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        _writableState: [WritableState],
        writable: false,
        allowHalfOpen: true,
        _transformState: [Object] },
     bodyUsed: false,
     size: 0,
     timeout: 0,
     _raw: [],
     _abort: false },
  status: 406 }

I don't understand why....

Thanks for your help

Benoit.

BenWaNH avatar May 12 '19 16:05 BenWaNH

Same problem

ishapkin avatar Mar 13 '20 18:03 ishapkin

see: https://api-platform.com/docs/client-generator/react/#generating-a-progressive-web-app hydra Try to enable Hydra (json-ld) in your application. Don't forget to clear cache.

veritas-ko avatar Apr 14 '20 17:04 veritas-ko