I'm sending a GET
request using axios
. What I'm trying to pass to this request is a raw data body (type: Object)
Here's the code:
export const getAssignQC = async (
projectId,
interviewId,
userId,
step,
status,
type
) => {
try {
return await axios({
method: "get",
url: "https://{myIp}/qualitycontrol/checkAssignQC",
headers:{},
data: {
projectID: projectId,
interviewID: interviewId,
userID: userId,
step: step,
status: status,
type: type,
}
});
} catch (error) {
console.log("Error in getting assign qc", error);
}
};
Here's the result:
Network inspector
Meanwhile, the request works fine on Postman:
What I've tried :
data: formData
(the keys, values have been appended)PLEASE HELP!
I think you are missing the double slash after 'https':
url: "https:{myIp}/qualitycontrol/checkAssignQC",
I have also made a working sample, if it helps: https://codesandbox.io/s/cold-thunder-iprks?file=/src/App.js
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.