API action: Server returned code: 406

Hi,

I’m seeing this when attempting to define the schema an API call. The call works perfectly in Insomnia/Postman.

The returned content-type is application/json; charset=utf-8

Is this the problem??

Is Wappler struggling to deal with the charset=utf-8 aspect ?

Is the source available to review ??

Maybe the remote api server is requiring that you call it with specific headers like accept/json - so you need to define those first.

I have defined them. It’s all working in Insomnia. It’s the Wappler API action that’s raising the error.

My guess is it simply can’t deal with content-type: application/json; charset=utf-8

And is simply crashing out.

No that is not the case. Json response is actually the exact what Wappler expects to get.

406 is returned by the server not Wappler so it means bad requests headers. So maybe you didn’t pass everything needed.

If I share the details, can one of your team try please?

I’ve had no issue with APIs that return

content-type: application/json

Do you see this code 406 returned only when trying to fetch schema, or also when you run the server action in the browser?

When defining schema. Didn’t take it any further and try it in App

Can you run the server action without defining the schema and see if it runs fine?

Hi @Teodor
I’ve encountered the same problem as described in this topic.
As you suggested - the error 406 is only returned when trying to fetch the schema.
When I’ve tried running the action in the browser, it completes successfully.

Is this a known bug/error with the ‘Define Scheme’ function of the API Data Source connector?
Any idea if a fix is possible?

I’ve attached an image below of the 406 error reported by the Define / Fetch schema button.