SolrNet / SolrNet

Solr client for .Net
https://github.com/SolrNet/SolrNet?tab=readme-ov-file#documentation-index
Apache License 2.0
931 stars 797 forks source link

AutoSolrConnection should use MultipartFormDataContent in case of POST action rather than FormUrlEncodedContent #625

Closed drarasid closed 2 weeks ago

drarasid commented 2 weeks ago

When using MaxUriLength attribute for AutoSolrConnection, http client is using correct http method, but in the same time content is pushed into URI due to FormUrlEncodedContent. In case of very long query string, when query fails due to "Too long URI", MaxUriLength does not solve the problem, because URI stays unchanged and only HTTP method is changed.

drarasid commented 2 weeks ago

Further investigation showed that problem is not related content type, but to line u.Query = null; where param wt=xml is removed from query as well and xml parser fails with error when trying to parse JSON response. Closing this issue.