How To Install ghc-http-media on Fedora 36

In this tutorial we learn how to install ghc-http-media in Fedora 36. ghc-http-media is Processing HTTP Content-Type and Accept headers

Introduction

In this tutorial we learn how to install ghc-http-media on Fedora 36.

What is ghc-http-media

This library is intended to be a comprehensive solution to parsing and selecting quality-indexed values in HTTP headers. It is capable of parsing both media types and language parameters from the Accept and Content header families, and can be extended to match against other accept headers as well. Selecting the appropriate header value is achieved by comparing a list of server options against the quality-indexed values supplied by the client. In the following example, the Accept header is parsed and then matched against a list of server options to serve the appropriate media using ‘mapAcceptMedia’ > getHeader »= maybe send406Error sendResourceWith . mapAcceptMedia > [ (“text/html”, asHtml) > , (“application/json”, asJson) > ] Similarly, the Content-Type header can be used to produce a parser for request bodies based on the given content type with ‘mapContentMedia’ > getContentType »= maybe send415Error readRequestBodyWith . mapContentMedia > [ (“application/json”, parseJson) > , (“text/plain”, parseText) > ] The API is agnostic to your choice of server.

We can use yum or dnf to install ghc-http-media on Fedora 36. In this tutorial we discuss both methods but you only need to choose one of method to install ghc-http-media.

Install ghc-http-media on Fedora 36 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install ghc-http-media using dnf by running the following command:

sudo dnf -y install ghc-http-media

Install ghc-http-media on Fedora 36 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install ghc-http-media using yum by running the following command:

sudo yum -y install ghc-http-media

How To Uninstall ghc-http-media on Fedora 36

To uninstall only the ghc-http-media package we can use the following command:

sudo dnf remove ghc-http-media

ghc-http-media Package Contents on Fedora 36

/usr/lib/.build-id
/usr/lib/.build-id/3d
/usr/lib/.build-id/3d/ccbd9c81e7a6a4e79d2d4c67c0ca0d740a85f5
/usr/lib64/libHShttp-media-0.8.0.0-I4Os9Jfve3vEBJFR3wLwoo-ghc8.10.5.so
/usr/share/licenses/ghc-http-media
/usr/share/licenses/ghc-http-media/LICENSE

References

Summary

In this tutorial we learn how to install ghc-http-media on Fedora 36 using yum and [dnf]((/fedora/36/dnf/).