Skip to content

[Web service] request inspector

HouzuoGuo edited this page Mar 21, 2022 · 4 revisions

Introduction

Hosted by laitos web server, the endpoint dumps the incoming HTTP request for your inspection - this includes the request headers, request body, etc.

This often comes in handy as a diagnosis tool for deploying laitos web server behind intermediary components, such as a load balancer or an API gateway, which often manipulates client's HTTP requests by changing the headers and/or request body.

Configuration

Under the JSON key HTTPHandlers, add a string property called RequestInspectorEndpoint, value being the URL location of the service.

Keep the location a secret to yourself and make it difficult to guess. Here is an example:

{
    ...

    "HTTPHandlers": {
        ...

        "RequestInspectorEndpoint": "/my-request-inspector",

        ...
    },

    ...
}

Run

The service is hosted by web server, therefore remember to run web server.

Usage

Use an HTTP client (browser application, command line tool, programming library, etc) to send an HTTP request to the endpoint.

The endpoint will respond in plain text:

  • HTTP request protocol, URL path, query parameters.
  • HTTP request headers.
  • HTTP request body.

Tips

  • Make the endpoint difficult to guess, this helps to prevent misuse of the service.
Clone this wiki locally