Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
params = {
url: "http://178.21.406.842/api/GetHistoricalDataByAttributes?"+encodeURI(queryParams)
};
var historicJson = Resources["ContentLoaderFunctions"].GetText(params);
Above is code am writing to get historic data. If am trying to get last 6 months data which is huge like more than 300Mb in that case it gives me connection close.
Am testing above code as thingworx service from fiddler client and i receive 500 status and connection close.
How to optimize in thingworx if data sent is huge and stop closing the connection?
When am testing i get following error:
"The request was aborted: The connection was closed unexpectedly. at System.Net.HttpWebRequest.GetResponse()"
I don't think REST API it's the right approach to download 300Mb of data, or at least right on TW. You may need a proxy which does this job and puts historical data on FileRepository ( or FTP Server ), or you may try to Zip contents at origin to see if size decreases on a significative way, or cut original data in junks ( let's ask instead of 6 months of data, ask in junks of 15 days of data --> will be about 25Mb )
This is likely a limit of the webserver that you are making the GET request to and/or your Tomcat configuration, not a limit of Thingworx. Please see the following StackOverflow question: web services - maximum length of HTTP GET request? - Stack Overflow
That said, HTTP may not be the best way to expose this data, as noted by Carles.
Can we set limit of response returned from GET request in tomcat? Response which i am receiving is huge data