score:1
it looks like user.valid?
returns false
, so your else
statement kicks in:
render json: { error: 'failed to create user' }, status: :not_acceptable
the status: :not_acceptable
generates the 406
error.
you should probably include the reason why user is not valid, and return a bad request response instead:
render json: { error: user.errors.full_messages}, status: :bad_request
Source: stackoverflow.com
Related Query
- How to send react object to rails api with a post fetch request? 406 error
- Post an object with fetch using react js and express API server
- How to send a fetch post request from react component to backend
- How to fix "Response to preflight request doesn't pass access control check: It does not have HTTP ok status" error in react app with nodejs api
- how to store textarea new line value into array with react and send it to node js variable with post request
- how to disable fetch API to send OPTIONS request with Content-Type header?
- How can I send a request to API with on click of my button in React hooks?
- How to send data using fetch and POST request with credentials included?
- how to convert an array to a array of objects with additional information in react using map when doing a POST api request
- Error handling API fetch request with React
- How to send current date time to Rest Api with put request in react js?
- Why am I getting error 415 on fetch request with POST method in react JS
- How to bypass CORS error when sending POST request to Google Drive API from react application?
- Fetch request fails when I send POST request from React app to a Flask API
- How do I store JWT and send them with every request using react
- React Native: fetch request failed with error - TypeError: Network request failed(…)
- Fetch api post call returning 403 forbidden error in React js but the same URL working in postman
- react with Rails 5, getting CSRF error for post with axios
- How to post object using fetch with form-data in React?
- How to send POST request to Django API from ReactJS web app?
- In react with redux, how to do post request
- How to do a REST API post request with FileUpload to an Azure AD Protected REST API
- React and Redux: 401 Unauthorized Error POST API Request
- How to make a POST request with json content type with Semantic UI API
- How to send array of object in post request using axios library
- Can't access params sent in POST request from React client to Rails api
- React with Redux Axios get request error issue with laravel 5.2 api server
- fetch POST returns only _id object in Express API server React FrontEnd
- How to POST request using axios with React Hooks?
- How to fetch api via looped callbacks with React functional components
More Query from same tag
- Syntax Error when using Gulp to compile React in ES6
- Unexpected token '=' in React Component
- React: "this" is undefined inside a component function
- Is it OK to ignore missing NPM (peer) dependencies?
- react redux and thunks / axios / is not a function
- How to maintain state after a page refresh in React.js?
- Disable checkbox for item that is not defaultChecked
- How to change deeply nested states without explicitly providing a lot of context in actions?
- Failed prop type: The prop `value` is marked as required in `Rating`, but its value is `undefined`
- how to make component size variation with reactjs and styled components
- Trying to emulate Bootstrap navbar collapse/expand with React State
- React redundant prop validation
- Bind react component to part of redux state
- MenuItem click event targeted at render
- Avoiding stale state in double useEffect?
- Change boolean value onClick in React
- Uploading Multiple Images in React and Redux
- react-select: disable dropdown list
- Is the `window` object of React synthetic?
- How can I integrate a mailerlite.com signup form with React?
- React + Redux binded state has no data
- Expected to return a value at the end of arrow function on reactjs how to fix this error?
- Redux Saga in a loop confusion
- Unexpected character '@' (1:0) on Gatsby after installing package
- React: Passing a Prop in w/ event for setState
- Universal react rendering with a CDN and heroku
- axios not including firebase headers on post
- React Router - Why is the switch not changing html when the path changes?
- I cannot find the error TypeError: Cannot read properties of undefined (reading 'name')
- Create a react state that changes with time