Rooyca / obsidian-api-request

Obsidian plugin that allows you to make requests to API's and receive responses in codeblocks or store them in localStorage.
https://rooyca.github.io/obsidian-api-request/
MIT License
78 stars 4 forks source link

Define API request in markdown code block #1

Closed mAAdhaTTah closed 4 months ago

mAAdhaTTah commented 1 year ago

I love the idea of organizing my API requests in Obsidian, but the way the plugin currently works, defining all the info in settings, is a bit limited for that purpose. What would you think about adding a feature so you can define the API request in a markdown code block so the preview would show the result of the API request?

adam1279 commented 1 year ago

I fully agree. That would be really useful.

Rooyca commented 1 year ago

That's a great idea. I would try implementing that after a finish a little project I'm doing now. I'll keep you guys post it.

Rooyca commented 1 year ago

I launched a first version (very rudimentary). Just for GET requests with the option to show a specific field from the response. I'll try to keep working on this.

mAAdhaTTah commented 1 year ago

@Rooyca I'm also happy to pitch in here if that's helpful.

Rooyca commented 1 year ago

@Rooyca I'm also happy to pitch in here if that's helpful.

That would be great!

Rooyca commented 10 months ago

Is anyone still interested on working on this?

Bodge-IT commented 6 months ago

I'm interested in using this

mAAdhaTTah commented 6 months ago

For some extra context, I took an initial look at this and tried to sketch out what would be required to do what I was hoping to do. I realized the implementation would be quite a bit more complex than I originally anticipated, so I spent some time looking into whether this had been solved in some other form. I found a few projects that were in the same vein:

vscode-restclient is probably the easiest to take inspiration and/or crib code from, although seems deeply integrated with VSCode such that it might be difficult to integrate into Obsidian. Of the other 3, Hurl seemed the most feasible to integrate (Rust via wasm is a common workflow, but would need to know/learn Rust), although if we wanted a custom implementation, writing a Karate parser is probably easiest (maybe write a wrapper around a Gherkin parser?).

Obviously, any of these approaches are pretty involved, so if you want something simple, maybe this isn't the best approach, but wanted to share what I found when I looked into this. Unfortunately, I don't have the time to take this further at this time.