Answer the question
In order to leave comments, you need to log in
How to make a simple POST request from Node?
I'm trying to send a regular POST with Node/Express and I'm getting a response:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
const https = require('https');
const options = {
hostname: 'connect.stripe.com',
port: 443,
path: '/oauth/token',
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
}
const req = https.request(
options, res =>
res.on('data', d =>
process.stdout.write(d))
)
req.write(data) // client_secret=stripe_sk&grant_type=authorization_code...
req.end()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question