My code:
var data = JSON.stringify(orderNo)
options.path = "/1/sales?merchantOrderId=" + orderNo
options.method = 'GET';
console.log(options)
var req = https.request(options, function (res) {
res.on('data', function (chunk) {
var retornoIds = iconv.decode(chunk, 'utf-8');
console.log(retornoIds)
}
});
});
req.write(data)
req.on('error', function (err) {
callback(err);
});
req.end();
My options:
{ hostname: 'apisandbox.cieloecommerce.cielo.com.br',
port: 443,
secureProtocol: 'TLSv1_method',
encoding: 'utf-8',
headers:
{ 'Content-Type': 'application/json',
MerchantId: 'xxxxxxxxxx',
MerchantKey: 'xxxxxxxxx' },
path: '/1/sales?merchantOrderId=VE805051701',
method: 'GET' }
I do not know what's wrong
{"Message":"The requested resource does not support http method 'GET'."}