0

I am using SodaClient to get information from a private data set in Socrata using the following code.

var records = (dynamic)null;

string searchCondition = "column1='something'AND (column2='something' OR 'somethingelse') ";

var clientExport = new SodaClient("host name", "app token", "username","password");

var dataset = clientExport.GetResource<modelname>("resourceid");
var offset = 0;
var limit = 1000;

var soql = new SoqlQuery().Where(searchCondition).Offset(offset).Limit(limit);
records = dataset.Query<modelname>(soql).ToList();

return records;

The problem is that sometimes the 'searchCondition ' can be very large say over 5000 characters, then the Sodaclient is returning error.

How can I send large soql queries to socrata? I also tried to get information using restful calls httpclient method but it also showing errors like.

An error occurred while sending the request. The server committed a protocol violation. Section=ResponseStatusLine

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Nachikethas
  • 43
  • 1
  • 8

1 Answers1

0

Unfortunately the length of HTTP query URLs, which SodaClient uses under the covers to make its RESTful API requests, is limited both by the HTTP/1.1 specification and also by practical limits within HTTP libraries themselves. Here's another StackOverflow post with more details: What is the maximum length of a URL in different browsers?

What are you putting into your search condition? Maybe I can help you come up with a more optimized way to issue your query.

Community
  • 1
  • 1
chrismetcalf
  • 1,556
  • 1
  • 8
  • 7
  • There is a 'Category' column which have 160 distinguished values. To search this i am using the following query – Nachikethas Aug 20 '15 at 05:34
  • There is a 'Category' column which have 160 distinguished values. To search this field along with other columns I am using the following query https://host/resource/xxxx-xxx.json?$where=(Category ='value1' OR Category ='value2' OR Category ='value3') AND SubCatagory = 'value1'. Please note that I cannot use the IN(..) functionality in this data set because it is a derived one, as per you said earlier for my question. So i have to relay on the OR method. – Nachikethas Aug 20 '15 at 05:40