Access to XMLHttpRequest at ‘https://api-sandbox.dwolla.com/customers’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: Request header field pragma is not allowed by Access-Control-Allow-Headers in preflight response.
I am trying to create customer from the frontend(React JS) using the clientToken generated from the NodeJS Server. Getting the above error.
Am I missing something in the code ? OR if the CustomerCreation is required to be called from the Server instead of client.
await axios(https://api-sandbox.dwolla.com/customers,
{
method: ‘POST’,
headers: {
Accept: ‘application/vnd.dwolla.v1.hal+json’,
Authorization: Bearer ${dwollaToken}
},
data: {
firstName: ‘Test’
lastName: ‘Name’
email: ‘test@test.com’
}
}
);
if (customerCreationResponse.status === 201) {
//code
}
This API Call is working with CORS UNBLOCK extension in Client Browser.