Http.get, http.call response.content different than curl, wget

Hi all,
I can curl or wget the following url:

http://store.volusion.com/net/WebService.aspx?Login=me@my.com&EncryptedPassword=E84DABEC568148C80855C87D&EDI_Name=Generic\Products&SELECT_Columns=p.ProductCode,p.ProductName,pd.ProductDescription&WHERE_Column=pe.Google_Product_Type&WHERE_Value=course

and the response.content will contain expected XML such as:

<?xml version="1.0" encoding="UTF-8"?><xmldata><Products><ProductCode>CR_LE1_2018.0104KC</ProductCode><ProductID>38275</ProductID><ProductName>20180104 Lower Extremity Level 1 …

But in meteor, when I HTTP.call('GET', URL… or HTTP.get(URL… , with or without {headers:{'Accept': 'application/xml' the response.content contains:

<?xml version="1.0" encoding="utf-8" ?><ReturnResult><Success>False</Success><Message>Could not find file &amp;#39;D:\Domains\ecommerce\_v_6_0_net\_v_6_5_net\net\schema\GenericCustomers.xsd&amp;#39;.</Message></ReturnResult>

Any help appreciated.
Thanks, Chris

Looks like a valid response with an error message from the remote hosts internal code.

Also: standard warning about sending any kind of credentials (ie. EncryptedPassword) over plain old HTTP
If you’re sending it to authenticate, it is a password

1 Like

Agreed that it looks like a valid response. But I wonder why Meteor’s response is different from a curl response?

Also agreed about credentials over HTTP.

I’m suspicious about that backslash Name=Generic\Products. I’m wondering whether you’ve escaped it properly when writing the JS?

1 Like

That was it! You, sir, are a genius.

For anyone working with Volusion estore API, note the double backslash “\\” for the Generic\\Products collection (thanks robfallows).

Meteor.methods({
'volusionapi': function () {
this.unblock();
var apiUrl = 'https://store.volusion.com/net/WebService.aspx?Login=me@my.com&EncryptedPassword=E84DABEC568148C80855C87D&EDI_Name=Generic\\Products&SELECT_Columns=p.ProductCode,p.ProductName,pd.ProductDescription&WHERE_Column=pe.Google_Product_Type&WHERE_Value=course';
var response = HTTP.get(apiUrl, {
headers: {
'Accept': 'application/xml'
}
});
console.log(response.content);
return response;
    }
});

And don’t share your credentials over http (thanks coagmano).

2 Likes