Code Monkey home page Code Monkey logo

api.horse's Introduction

API testing without horsing around.

API.horse is a hosted tool you can use to test APIs with. You can send test requests to endpoints and see the responses, or host endpoints yourself for testing your webhooks.

CURRENTLY IN DEVELOPMENT - this tool is currently in development, but I'll be saddling up within a few days.

Development goals

  • Full request tester and response logger
  • Secrets, so your shared links don't include keys & tokens
  • Instant sharable links to your session
  • Hosted endpoints for sending requests to

Future goals

  • An API gateway to provide logging and debugging to third party APIs
  • Make the user interface look less Githubby.

Development status

Each piece of the user interface is composed of its own custom HTML element, brought together using PHP.Gt/WebEngine. I've just completed building the user interface of API.horse, and before I implement the functionality, I want to introduce a long-awaited feature of WebEngine: Components with their own PHP. There's never a better time to improve a tool than when building a silly side project like this. I've completed building the PHP component functionality, so now the plan is to simply build and test the project's originally-planned functionality. I will release the first version on www.api.horse as soon as it's usable.

Why does it look like Github?

Currently the user interface is built to look and feel just like Github. This is intentional, because I personally have no ability at creating good designs, but I am quite comfortable in implementing a design once I can see it. I'm really familiar with Github's user interface, so for now I've just copied that. Once the product's in use, I'll hire a graphic designer to give it its own look and feel.

What's with the name? ๐Ÿด

Naming stuff is hard, but I don't think a product's name really matters, so I went with a stupid name that is memorable, and is a short URL. That's all there is to it.

api.horse's People

Contributors

g105b avatar

Watchers

 avatar  avatar

api.horse's Issues

Request: convert beteween body types

Another nice-to-have would be to automatically convert between body types. If I've set a key-value-pair list as a multipart form body, and I switch to JSON, it would be lovely to see the key-value-pars automatically populated in a JSON object.

Collections: allow switching and creating named collections in top bar

The new/fork buttons don't really make sense the way I've implemented things. Instead, I think it would be super useful to put the requests into collections.

image

This beautiful screenshot shows the simple idea of a dropdown where you can name the current collection, or expand to get a "New collection" button.

The name of the collection is just for the viewer's benefit. It will still be stored as a ULID (as it currently is).

Request: Secrets

Secrets should be stored in the secrets tab along with the ability to automatically expand variables within requests.

Request: Automate content-type header from body

If I choose a body type of "Json", and I haven't already set the Content-type header, there should be a button/link available to "Set header: Content-type: application/json". That would be a nice touch.

UI: Turbo blocking click

  • Turbo updates the inner HTML of an element after the form automatically submits.
  • The submit is done when an element loses focus.
  • An element may lose focus when the user clicks another element.
  • If the clicked element is within the replaced HTML, the click is lost, requiring a second click to register.

Fork: Collection switcher on shared URLs

To simplify the UX for shared URLs, the collection switcher should be hidden when viewing a shared collection. The Fork button should be visible, along with the collection name, but there should be a link <- back to your collections to exit from the shared state.

Turbo: Multiple requests dispatched

Changing the name field, then pressing ENTER causes two Turbo events to fire.

This causes a race condition, where sometimes the page has to refresh because the old name isn't found (due to it already having been changed).

Response viewer: clear old responses

There's already a delete button on the request to remove it completely. I would like to see a clear button above the responses, to remove any record of old responses.

Response viewer: new to old order

The responses are currently shown in reverse-chronological order, but once #3 is implemented it will make more sense to display the responses in order, with the newest at the bottom of the list, but automatically open.

Variables: allow calculation of variables for injection

Inject variables in the same way as with secrets {{like_this}}, but this feature is to allow calculating variables by executing a script of some sort.

The main use case here is how Spektrix calculates its authentication header. It requires a multi-step cryptography process to generate a time-based auth header for each request. This is impossible to calculate prior to execution, so has to be generated on the fly for each request. I would love to use horsey to test this API!

Explain changes between requests

The current implementation shows a list of responses associated to the current request, which only really makes sense if none of the parameters change on the request between responses.

If I create a request, execute it so I can see the response, and then change something like the query strings or method, what should happen to the existing responses? They could be deleted, but I think it would be better to keep them, but show what's changed.

This can be done using bindListCallback() here instead of bindList(). The ResponseEntity will need to take a reference of the RequestEntity in the constructor (like it used to), and then for each iteration it can check what's difference, and list out the changes to the page.

Feature: Gateway

We've got "request", and we've got "web hook". A really cool feature would be "gateway".

Some APIs, like Stripe, have fantastic developer tooling. Every request I send to Stripe's API gets logged, and I can inspect the data coming in and going out, and I can share a request ID with their support team really easily.

Not all APIs are as good as Stripe's, but with an API Gateway, it could be.

Instead of sending your application's requests to the vendor's endpoint, send it to horsey's gateway instead, which will relay it on. Then you can inspect the request and response, logged like Stripe does, but for crappy APIs that don't offer logging!

An additional feature could be to handle weird/complex authentication, so your application can use a simple key when authenticating to horse.

UX: Sponsorship page and WIP popup

The sponsorship page should take its content from the README.

On areas of the app that aren't finished, a popup should be displayed to explain that this is an always-free side project, built solely for my own benefit and to attract sponsorship.

Share: CollectionRepository and sharing URLs

Currently we only have the CollectionRepository used throughout.

I want to remove all manipulation functions from this repository, such as save, create, etc. so that by default it's impossible to change the contents of a Collection.

Then, the ServiceLoader can check the ShareID in the URL matches the ShareID in the session, and if it does, return a PrivateCollectionRepository with the save, create methods implemented.

Then in the go function, we can disable all HTML fields if !$collectionRepository instanceof SharedCollectionRepository, but we don't need to worry about client side security, because the methods are simply not there unless the session is set correctly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.