nodejs-ebay-api
nodejs-ebay-api copied to clipboard
ebayApiPostXmlRequest request is incorrect
I started using the current master branch that utilizes the request module...however I started having code failing giving me the error
{
"EBayTime": "2014-10-03 18:43:44",
"Errors": {
"Error": {
"Code": "2",
"Column": "0",
"ErrorClass": "RequestError",
"Line": "0",
"Severity": "SeriousError",
"SeverityCode": "1",
"ShortMessage": "Unsupported verb."
}
}
}
After fooling with this for a few hours and ensuring that everything was going to ebay as they expected...I reviewed the code around utilization of request.
In the ebayApiPostXmlRequest function there is an object called options.reqOptions which contains data for the xml body and headers for the request headers. However, when it is handed off to the request module the options.reqOptions is passed into the request headers parameter...which is incorrect
current (i assume broken?)
var request = requestModule.post({'url': url, 'headers': options.reqOptions}, function(error, response, result) {
working (assume fix?)
var request = requestModule.post({'url': url, body: options.reqOptions.data, 'headers': options.reqOptions.headers}, function(error, response, result) {
Hope this helps anyone that has seen this issue..