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.

Feature request: support sending a json body with http request

See original GitHub issue

#39 In order to use this as a way to get any valuable info from the sprinklr api, it would need to support being able to send a json body. For example: request.AddParameter(@"application/json", "{\n\t\"sinceTime\":" + epochFromInMilliseconds + ",\n\t\"untilTime\":" + epochNowInMilliseconds + ",\n\t\"details\": {\n\t\t\"widgetType\": \"STREAM\"\n\t},\n\t\"messageFormatOptions\": \"strip_html,strip_url\",\n\t\"filters\": [\n\t\t{\n\t\t\t\"dimension\": \"TOPIC\",\n\t\t\t\"filterValues\": [\n\t\t\t\t\"" + definedTopic.Id + "\"\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"dimension\": \"MEDIA_SOURCE\",\n\t\t\t\"filterValues\": [\n\t\t\t\t\"REDDIT\",\n\t\t\t\t\"TWITTER\",\n\t\t\t\t\"FACEBOOK\"\n\t\t\t]\n\t\t}\n\t],\n\t\"metric\": \"MENTIONS\",\n\t\"start\": 0,\n\t\"rows\": 150\n}", ParameterType.RequestBody);

I believe many people would find this useful. Sprinklr is the best enterprise tool for understanding what people are talking about across all public domain social platforms. This information is valuable for corporations, research, etc.

Please let me know if I can provide any more info. Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:12
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
marcusolssoncommented, Jan 27, 2021

Judging by the votes on the original post, this is important to many users. I’ll get started working on this!

@smarkm I think what you’re asking for is a bit different from what the original poster meant. To answer your question though: No, generic query parameter as variables is not supported. If you’d like to accomplish something like this you’d have to use dashboard variables, which is supported in both the path and query string fields.

1reaction
casieocommented, Feb 6, 2021

Ok, so here’s an update on this. I’ve discussed this thread with the Grafana team, and I’ve decided to add support for POST requests. The reasoning is that the difference between GET and POST in this case is only semantic. There’s nothing stopping you from building a REST API that uses GET to create resources. Similarly, there are APIs that only uses POST for all operations, including reading data.

With that, I also decided to add the support for settings a request body back in there. Unfortunately, due to the browser limitation I mentioned earlier, GET requests don’t support a request body. You’ll get a warning that tells you the body is being ignored.

I’ve released v0.9.0, which introduces a brand new query editor. Since this is a pretty big change, I’ll hold off on publishing this for a bit to let people try it out first.

You can install it by running:

grafana-cli --pluginUrl=https://github.com/marcusolsson/grafana-json-datasource/releases/download/v0.9.0/marcusolsson-json-datasource-0.9.0.zip plugins install marcusolsson-json-datasource

Please read the CHANGELOG.md before installing it.

This is working beautifully! Thank you! Will also play with word cloud panel, etc. sprinklr

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add a Request Body to a POST Request | API Connector
This article describes how to add a request body to a POST , PUT , or PATCH request using the API Connector extension...
Read more >
Making a JSON POST Request With HttpURLConnection
In this tutorial, we'll demonstrate how to make a JSON POST request using HttpURLConnection. Further reading: Do a Simple HTTP Request in Java....
Read more >
JSON requests and responses - Atlassian Developer
Instead of XML you may provide and accept entities as JSON , a simpler and more concise ... To make a request with...
Read more >
How to send a POST request with JSON body? - Stack Overflow
What is the correct way to submit a POST request with a JSON body? import http.client, urllib.parse def update_status(status, versionId): conn = ...
Read more >
Request.json() - Web APIs | MDN
The json() method of the Request interface reads the request body and returns it as a promise that resolves with the result of...
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