Community
Forma Developer Forum
Welcome to Autodesk Forma Developer Forum. Share your knowledge, ask questions, and explore popular Forma API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

extensions.invokeEndpoint() fails for content type "application/json; charset=utf-8"

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
vkokkinidis
194 Views, 3 Replies

extensions.invokeEndpoint() fails for content type "application/json; charset=utf-8"

Hello,

 

Tried calling Forma.extensions.invokeEndpoint() towards a backend service that returns "application/json; charset=utf-8" as content type.

 

The network call is successful, but the extension emits an error saying it's unsupported.

 

forma-extension-invokeEndpoint.png

 

Do we have to explicitly return 'application/json' ?

Thanks!

 

Labels (1)
3 REPLIES 3
Message 2 of 4

Hello!

 

The media type of "application/json" does not define any optional parameters [1] such as charset. The standard also requires the use of UTF-8 [2].

 

Are you able to remove the charset parameter?

 

[1] https://datatracker.ietf.org/doc/html/rfc8259#section-11

[2] https://datatracker.ietf.org/doc/html/rfc8259#section-8.1

 

Henrik

Message 3 of 4

We've deployed a change now to not be too strict on our side for this checking. Your original content-type value should work now for this case. Note that the exact charset specified will be ignored (always parsed as UTF-8).

 

Let us know if you see any more problems around this.

 

Henrik

Message 4 of 4

Thank you for your speedy fix.

 

The backend service is a boilerplate asp.net core (.net 6 framework).

Apparently, Microsoft insists on automatically appending a 'charset', although against the standard as you pointed out.

 

Handling it on your side is very helpful.

Cheers!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report