question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use form data to submit query

See original GitHub issue

Hi all, I recently ran into an issue with long queries (requesting a lot of fields) where the URI that is being constructed gets too long and due to the “q=” parameter that has more than 64000 characters the request is rejected (“URI too long”).

Though I admit that maybe that type of query is questionable, I found out that InfluxDB also reads the query parameter from multipart form data (see https://github.com/influxdata/influxdb/commit/f58a50c231afd6ee775ce213461c7c0043cd724f)

With the following code I was able to successfully submit a longer query to InfluxDB:

HttpClient client = new HttpClient();
MultipartFormDataContent form = new MultipartFormDataContent();
form.Add(new StringContent("..."), "u");
form.Add(new StringContent("..."), "p");
form.Add(new StringContent(reallyLargeQuery), "q");
string url = $"http://localhost:8086/query?db={this.database}";

client.PostAsync(url, form)

Would that be something that could be changed in this client?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
dreamon-ddcommented, Oct 11, 2017

Tested, works super, thanks a lot!

1reaction
tihomir-kitcommented, Oct 10, 2017

Deployed v8.0.1, all should be fine now. I tested both net461 and netcore2.0 and all tests now pass for both targets. Let me know. 😃

cheers

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Transform FormData into a Query String
In this article, we're going to look at the HTML for a basic form that will then have a submit event bound to...
Read more >
Sending form data - Learn web development | MDN
As we'd alluded to above, sending form data is easy, but securing an application can be tricky. Just remember that a front-end developer...
Read more >
When submitting a GET form, the query string is removed ...
when method is GET and form is submitted, hidden input element was sent as query parmater. Old params in action url were wiped...
Read more >
How to Submit a Form with JavaScript – JS Submit Button ...
To submit a form using JavaScript, you must first create the form and add distinctive, specific attributes to the input fields.
Read more >
Use a query as the record source for a form or report
You can use a query to supply data to a form or report in Access. You can use a query when you create...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found