Hoodie Client + React Native
See original GitHub issueFirst of all, thank you all for such an amazing tool 💯
I’m building an app that I want to be resilient when dealing with adverse network conditions and I think Hoodie is the right choice so I’ve been trying to integrate the Hoodie client with React Native but I keep getting these 415 Unsupported Media Type
errors. One possible fix (that works for me) is to use application/json
as a Content-Type
in @hoodie/account-client/utils/request.js
but I’m not familiar enough with Hoodie to tell if we can do that without breaking the client for other platforms (web).
Is there any reason why @hoodie/account-client/utils/request.js
uses application/vnd.api+json
instead of application/json
as a Content-Type
?
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
React Native Sweatshirts & Hoodies for Sale - Redbubble
Shop React Native Hoodies and Sweatshirts designed and sold by artists for men, women, and everyone. High-quality, pre-shrunk heavy or lightweight fleece.
Read more >React Js Hoodies & Sweatshirts | Unique Designs - Spreadshirt
Shop React Js Hoodies & Sweatshirts from talented designers at Spreadshirt ✓ Many sizes, ... React Native TSHIRT - Unisex Long Sleeve Hoodie...
Read more >Hoodie: A Full Stack Development Front-End Tool - Toptal
Hoodie is an exciting new framework which puts the control over app design ... At Toptal, he successful matched thousands of developers with...
Read more >React Native Hoodie - CrazyMonk
React Native Hoodie · Material/ Fabric: 100% Cotton, Bio-Wash · Size & Fit: This brand runs true to size. To ensure the best...
Read more >Integrating JSON API (Hood.ie) with React Native
The Hoodie client sends a JavaScript object, after this the xhr module stringifies it and the result is what is being sent. –...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, I see. Yeah, now it makes sense. Thanks for the quick response @gr2m
I think I just discovered the root cause of the issue, it looks like Android somehow adds a media type parameter to the
Content-Type
header (charset=utf-8
) and according to http://jsonapi.org/format/ “Clients MUST send all JSON API data in request documents with the header Content-Type: application/vnd.api+json without any media type parameters.”. This issue is not present in iOS. Once I find a proper fix will post it back here.Here’s my first attempt, @gr2m : https://www.npmjs.com/package/hoodie-plugin-react-native-server
Let me know what you think.