it-tools icon indicating copy to clipboard operation
it-tools copied to clipboard

HTTP Request Tool

Open Trip7274 opened this issue 1 year ago • 6 comments
trafficstars

What tool do you want? Example: an HTTP request tool

Describe the solution you'd like A simple, powerful, and easily shareable HTTP request tool, where you can also export the request in curl format, or even a few popular languages

Is their example of this tool in the wild? Cyberchef has a good implementation, but I found it doesn't work very well with some requests for some reason, namely Cloudflare API calls

Additional context Having a "share" button maybe nice, along with a warning if you had any authorization headers to avoid leaking your tokens, but that's not a requirement for it to be an amazing tool

Trip7274 avatar Jan 14 '24 14:01 Trip7274

Hi @iGamerTrip, this is not really possible from a browser, JS cannot access everywhere, will require a local application or server side, so probably not the goal of this project

But a curl command generator could be possible

sharevb avatar May 09 '24 07:05 sharevb

While i dont know a lot about JS, I've noticed that Cyberchef does have that functionality from the browser, and so does Postman

It also doesn't necessarily need to be able to access everywhere, just public APIs and the like Postman seems to suggest fetch() for JS, and here's an example code snippet it provided:

const requestOptions = {
  method: "GET",
  redirect: "follow"
};

fetch("https://api.sampleapis.com/switch/games", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result)) // Returns a list of Switch games!
  .catch((error) => console.error(error));

I apologize if this is simply unfeasible, or if I'm misunderstanding things, as my area of expertise lies moreso in Python than JS, but I thought this might help get my point across

Trip7274 avatar May 11 '24 01:05 Trip7274

Hi, yes, for api calls, (supposing CORS policy is ok), but will not work for websites as JS is not allowed to call everywhere (security)

By the way curl generator and translation to langages is possible

sharevb avatar May 11 '24 08:05 sharevb

Yeah, a better name for this issue is probably "API Request Tool", as it'd be good to test APIs (with proper CORS policies) with And a curl/popular languages generator would be really cool as well!

Trip7274 avatar May 11 '24 21:05 Trip7274

HI @Trip7274 and @CorentinTh, implemented i #1168

sharevb avatar Jun 16 '24 19:06 sharevb

Thanks a ton!

Trip7274 avatar Jun 17 '24 10:06 Trip7274