DEV Community

Mike Solomon for Meeshkan

Posted on • Originally published at meeshkan.com

5 2

Introducing HTTP types

At Meeshkan, we've recorded millions of HTTP transactions. In doing so, we've noticed that there's no standard format for recording them. Even within our own company (which only has 10 people!) we managed to create competing standards for recording HTTP traffic.

To fix this, we've created an open standard for storing HTTP transactions. With it, we hope to achieve one of two outcomes:

  • http-types evolves into an ISO standard, or
  • Someone smarter than us will either make something better or point us to a better standard.

In the absence of either of these things for the time being, we're happy to announce http-types!

The format

The top-level type in http-types is the HttpExhange, an object with two keys:

  • request: the incoming request, and
  • response: the outgoing response

The following is an example of a request and response stored in the HttpExchange format:

{
  "request": {
    "method": "get",
    "protocol": "http",
    "host": "example.com",
    "headers": {
      "accept": "*/*",
      "user-agent": "Mozilla/5.0 (pc-x86_64-linux-gnu) Siege/3.0.8"
    },
    "pathname": "/user/repos",
    "query": { "param": "value" },
    "timestamp": "2018-11-13T20:20:39+01:00"
  },
  "response": {
    "statusCode": 200,
    "body": "(response body string)",
    "headers": {
      "content-length": "1999",
      "content-type": "text/html; charset=utf-8"
    },
    "timestamp": "2018-11-13T20:20:39+02:00"
  }
}
Enter fullscreen mode Exit fullscreen mode

More detailed documentation can be found on the http-types GitHub repo. We also have a small website for the project with a general overview.

Client libraries

We've written http-types client libraries in the most common languages we use at Meeshkan. The current available client libraries are:

If you'd like to contribute a client library, please propose one on our GitHub issues page.

We would love to see more people play with http-types. While it's far from perfect, it has been relatively stable within Meeshkan and we think it can serve as a good basis for community discussion on how to store web traffic.

If you find it useful or have any questions/comments/criticisms, please let us know in the comment section below.

Enjoy http-types!

SurveyJS custom survey software

Build Your Own Forms without Manual Coding

SurveyJS UI libraries let you build a JSON-based form management system that integrates with any backend, giving you full control over your data with no user limits. Includes support for custom question types, skip logic, an integrated CSS editor, PDF export, real-time analytics, and more.

Learn more

Top comments (0)

Billboard image

Try REST API Generation for MS SQL Server.

DevOps for Private APIs. With DreamFactory API Generation, you get:

  • Auto-generated live APIs mapped from database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay