1

I am writing axios post function to search for vehicle details using chassis number and other details .. Postman shows no error and works very well but it shows 403 error when trying to run the code

export const searchByChassis = (chassis: string, seq?: string, customNo?: string) => async dispatch => { return await axios( { method: 'post', url: '/api/sticker/details', headers: { 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8', 'x-clientId': xClientId, "Access-Control-Allow-Origin":"*" }, data: { chassis: chassis, seq: seq ? seq : "NULL", customNo: customNo ? customNo : "NULL" } }) .then(response => {

  return JSON.stringify(response);
}).catch((error) => console.log(error));

1 Answer 1

-1

403 error code might be a result of access permission. Have you checked if the authentication was successful? Are you missing any API keys that are required? May be your passing the keys correctly from Postman and missing them in the actual API calls from the code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.