Skip to content

Commit

Permalink
minor change to README
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavs committed Aug 28, 2024
1 parent 2fa15f4 commit c14242c
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,57 @@
# HTTPlex - test and debug HTTP requests
# HTTPlex - a simple HTTP request & response service

HTTPlex is an Elixir-based web service that provides a simple HTTP request and response service. It is inspired from [httpbin](https://httpbin.org/) and helps developers test and debug HTTP requests.

## Features

The project is built using Elixir and the Phoenix framework. It defines a controller (`HTTPlexWeb.APIController`) that handles various HTTP endpoints:

HTTP Methods:

- `index/2`: Welcome message
- `get/2`, `post/2`, `put/2`, `patch/2`, `delete/2`: Return request info for respective HTTP methods
- `anything/2`: Accepts and returns data for any HTTP method

Request Inspection:

- `ip/2`: Returns the client's IP address
- `user_agent/2`: Returns the user-agent header
- `headers/2`: Returns all request headers

Response Inspection:

- `response_headers/2`: Sets custom response headers

Auth:

- `basic_auth/2`, `hidden_basic_auth/2`: Test Basic Authentication (hidden version doesn't send WWW-Authenticate header)
- `bearer/2`: Tests Bearer Token Authentication
- `digest_auth/2`: Tests Digest Authentication

Status codes:

- `status/2`: Returns response with specified status code

Request formats:

- `forms_post/2`: Handles form data submission

Response formats:

- `html_response/2`: Returns an HTML response
- `json_response/2`: Returns a JSON response
- `xml/2`: Returns an XML response
- `image/2`: Returns an image in specified format

Redirects:

- `absolute_redirect/2`: Performs absolute redirects
- `redirect_to/2`: Redirects to specified URL
- `redirectx/2`: Performs multiple redirects
- `relative_redirect/2`: Performs relative redirects

Dynamic data:

- `uuid/2`: Generates and returns a UUID
- `random_bytes/2`: Returns random bytes
- `deny/2`: Simulates denied access by robots.txt
Expand All @@ -54,17 +64,20 @@ Dynamic data:
- `stream_json/2`: Streams JSON data

Cookies:

- `get_cookies/2`: Returns all cookies sent with the request
- `set_cookies/2`, `set_cookie/2`: Set multiple or a single cookie
- `delete_cookies/2`: Deletes specified cookies

Encoding:

- `brotli/2`: Returns Brotli-encoded data
- `deflate/2`: Returns Deflate-encoded data
- `gzip/2`: Returns GZip-encoded data
- `encoding_utf8/2`: Returns UTF-8 encoded text

Caching:

- `cache/2`: Tests caching headers
- `cache_control/2`: Sets Cache-Control header with specified max-age
- `etag/2`: Tests ETag functionality
Expand All @@ -76,6 +89,7 @@ Each function or group of functions corresponds to different features or test sc
To use HTTPlex, send HTTP requests to the appropriate endpoints. The service will respond with JSON data (in most cases) containing the requested information or performing the specified action.

For example:

- `GET /ip` will return your IP address.
- `POST /post` with some data will echo back information about your POST request.
- `GET /status/404` will respond with a 404 status code.
Expand All @@ -86,8 +100,8 @@ This service is particularly useful for testing HTTP clients, debugging web appl

To start your Phoenix server:

* Run `mix setup` to install and setup dependencies
* Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`
- Run `mix setup` to install and setup dependencies
- Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`

Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.

Expand All @@ -99,15 +113,15 @@ The theme is available as open source under the terms of the [MIT License](https

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/abhinavs/httplex.
Bug reports and pull requests are welcome on GitHub at <https://github.com/abhinavs/httplex>.

## Other Projects

If you like HTTPlex, do check out my other projects
* [soopr](https://www.soopr.co) - a tool that supports you in content marketing
* [ping](https://www.apicblocks.com/ping) - monitor your websites's uptime
* [annexr](https://www.annexr.com) - chat based search for your website.
* [apicagent](https://www.apicagent.com) - a FREE API that extracts device details from user-agent string

- [soopr](https://www.soopr.co) - a tool that supports you in content marketing
- [ping](https://www.apicblocks.com/ping) - monitor your websites's uptime
- [annexr](https://www.annexr.com) - chat based search for your website.
- [apicagent](https://www.apicagent.com) - a FREE API that extracts device details from user-agent string

✨⚡You can read more about me on my [blog](https://www.abhinav.co/about/) or follow me on Twitter - [@abhinav](https://twitter.com/abhinav)
✨⚡You can read more about me on my [blog](https://www.abhinav.co/about/) or follow me on Twitter - [@abhinav](https://twitter.com/abhinav)

0 comments on commit c14242c

Please sign in to comment.