Skip to content

Commit

Permalink
feat(README): added Installation and Features sections
Browse files Browse the repository at this point in the history
  • Loading branch information
otaxhu committed Nov 8, 2024
1 parent b343bb9 commit 30a2b5e
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# HTTP Problem Details for Golang

Library for parsing and creating HTTP Problem Details, following RFC 9457 document, for ensuring compatibility between other libraries.
Library for parsing and creating HTTP Problem Details, following [RFC 9457 document](https://www.rfc-editor.org/rfc/rfc9457.html), for ensuring compatibility between other libraries.

<div>
<a href="https://pkg.go.dev/github.com/otaxhu/problem" style="text-decoration:none;">
Expand All @@ -17,6 +17,31 @@ Library for parsing and creating HTTP Problem Details, following RFC 9457 docume
</a>
</div>

## Installation
```sh
$ go get github.com/otaxhu/problem
```

## Features

- ### JSON and XML support:

You can encode/decode Problem Details in JSON and XML format using standard packages `encoding/json` and `encoding/xml`.

XML encoding/decoding has some limitations regarding `MapProblem` implementation, please read the [docs](https://pkg.go.dev/github.com/otaxhu/problem) to know more details.

- ### HTTP Client APIs:

As an HTTP client, you can parse HTTP Problem Details responses using `ParseResponse()` and `ParseResponseCustom()` functions.

- ### HTTP Server APIs:

As an HTTP server, you can respond to clients with Problem Details responses, using any of the available `Problem` interface implementations, encoding it using `ServeJSON()` or `ServeXML()` helpers.

- ### Polymorphic Problem Details and Easy extension members:

You can embed `RegisteredProblem` struct in your own struct, and extend it with any members you want, as allowed by [RFC 9457 Section 3.2](https://www.rfc-editor.org/rfc/rfc9457.html#name-extension-members)

## Quick Usage:

### Client code:
Expand Down

0 comments on commit 30a2b5e

Please sign in to comment.