question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hoodie Client + React Native

See original GitHub issue

First 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:open
  • Created 6 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
alterxcommented, Apr 20, 2017

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.

0reactions
alterxcommented, Jul 6, 2017

Here’s my first attempt, @gr2m : https://www.npmjs.com/package/hoodie-plugin-react-native-server

Let me know what you think.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found