How to Install and Uninstall ghc-http-media Package on openSuSE Tumbleweed
Last updated: November 23,2024
1. Install "ghc-http-media" package
Please follow the guidelines below to install ghc-http-media on openSuSE Tumbleweed
$
sudo zypper refresh
Copied
$
sudo zypper install
ghc-http-media
Copied
2. Uninstall "ghc-http-media" package
Please follow the step by step instructions below to uninstall ghc-http-media on openSuSE Tumbleweed:
$
sudo zypper remove
ghc-http-media
Copied
3. Information about the ghc-http-media package on openSuSE Tumbleweed
Information for package ghc-http-media:
---------------------------------------
Repository : openSUSE-Tumbleweed-Oss
Name : ghc-http-media
Version : 0.8.1.1-2.4
Arch : x86_64
Vendor : openSUSE
Installed Size : 297.8 KiB
Installed : No
Status : not installed
Source package : ghc-http-media-0.8.1.1-2.4.src
Upstream URL : https://hackage.haskell.org/package/http-media
Summary : Processing HTTP Content-Type and Accept headers
Description :
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.
---------------------------------------
Repository : openSUSE-Tumbleweed-Oss
Name : ghc-http-media
Version : 0.8.1.1-2.4
Arch : x86_64
Vendor : openSUSE
Installed Size : 297.8 KiB
Installed : No
Status : not installed
Source package : ghc-http-media-0.8.1.1-2.4.src
Upstream URL : https://hackage.haskell.org/package/http-media
Summary : Processing HTTP Content-Type and Accept headers
Description :
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.