score:0
you can also try this code
return fetch(hostname, {
method: 'post',
headers: {
'content-type': 'application/json'
},
body: json.stringify({ variables: { input: data}})
})
.then((res) => {
return res.json()
})
.then((payload) => {
return payload
}).catch((error) => {
throw error
})
Source: stackoverflow.com
Related Query
- reactjs:unable to send the data in json format
- How to get the data from excel in JSON format in ReactJS?
- How to convert JSON data to XML format data and download the file in React JS
- What would be the best way to format JSON data consumed by a SPA?
- How to send json data from the backend (express.js) to the frontend (react) after res.status(404)?
- How to convert data array object to file JSON and use this file to send requests to the S3 server in ReactJS?
- Want to call an api to get the data from mongodb in json format but getting in raw format, using javascript, node.js, express, mongodb
- How to send and receive large JSON data
- How to convert server side Json data into react-google-chart format in Reactjs
- axios doesn't send post data to the back-end
- Send JSON data as multipart/form-data using axios POST Request
- How to send data from react and use the request body in express, using Axios?
- ReactJS: Unable to send JSON data and PDF file in one POST call
- Send data to the server via Formik
- Sort a json with nested objects structure and return a format same as the structure of json
- ERROR when fetch JSON data within the Multi-array in React JS?
- How to send data as string and not json on axios post
- Trying to send data in the body of a Axios GET to use in Django backend, but print of request.body is empty
- How to send the form data up a state using react-hook-form in react?
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data on React app
- How to format the JSON Structure in ReactJs
- How do I populate a JSON array with the data from my MYSQL database?
- How to validate the form and send user to another page on successful data filled in form fields in React JS?
- I have a data inside the state in T and Z format and React input accepts in the HH:MM ss format so how to convert
- getting error : fetch errorSyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data in react ajax call
- How do I render json data in the javascript function using map - Reactjs
- Can we send the JSON obtained from an API as a child component, instead of each individual attribute of the object?
- Why is React fetch ignoring the JSON data I'm getting?
- How to get the name of the array in json data using ReactJs?
- How do I use the react-admin's SelectArrayInput element to send data to the server as an array of objects i.e. { clients: [id: 1, id: 2]}?
More Query from same tag
- React responsive layout without CSS
- Prompt with callback when user tries to exit
- How to block negative values in Input tags while entering in forms
- How can I render an icon dynamically?
- How to set custom radio group into redux form
- Async return value from setState
- Append components to a fixed list using react-window?
- How to Route to different components in ReactJS
- Calling React JS from jsp
- ReactJs Production Code- Uncaught ReferenceError: process is not defined
- Typescript won't let me access property of an object using bracket notation
- onClick in button element not triggering re-render in react-table when using react hooks with graphql
- Using react-test-renderer w/ styled-components & Theme (React Native)
- Functions inside componentDidMount are undefined
- Why doesn't useEffect hook work as expected?
- Custom TTF fonts loading slowly in React app
- Get and use the previous state from local storage
- How to update react JS state functional component
- Transferring video streaming javascript code into React (ML5)
- Passing username and family name from google login
- ReactJS table in dropdown menu
- Axios multiple then's
- Javascript : When setState inside promise, getting an unending loop of output
- React: Map function with two parameters
- How do I check if object exist?
- React - can't render state value
- How to display Form using function
- How to expose/access a data store like Redux within a cypress test?
- How to import component in react native past two folders?
- In React, how do I pass arguments into a parent component's handleClick function?