You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe I am doing something stupid, but it looks like the data is not even parsed:
varClient=require('node-rest-client').Client;client=newClient();client.get('http://localhost:5050/workbooks/TotalDailyGrossRevenue/last-refresh-time',function(data,response){console.log('Data is a',typeofdata);});
note that there is no space between content-type and charset, while CURL is returning
"application/json; charset=utf-8"
with an extra space between content type and charset.
So to fix your issue you must set this content-type (with space) as a client config parameter as you can see in issue #12 and in nod-rest-client documentation.
varoptions={// customize mime types for json or xml connections //(in your case with a space between type and charset)mimetypes:{json:["application/json","application/json; charset=utf-8"],xml:["application/xml","application/xml; charset=utf-8"]}};Clientclient=newClient(options)
Maybe I am doing something stupid, but it looks like the data is not even parsed:
Results in:
Curling looks fine:
The text was updated successfully, but these errors were encountered: