diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..c55f7d029ba6d56ff0080797e6bfd7a4f7b7867b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,149 @@
+# Created by https://www.toptal.com/developers/gitignore/api/intellij,go
+# Edit at https://www.toptal.com/developers/gitignore?templates=intellij,go
+
+### Go ###
+# If you prefer the allow list template instead of the deny list, see community template:
+# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
+#
+# Binaries for programs and plugins
+*.exe
+*.exe~
+*.dll
+*.so
+*.dylib
+
+# Test binary, built with `go test -c`
+*.test
+
+# Output of the go coverage tool, specifically when used with LiteIDE
+*.out
+
+testdata/
+
+# Dependency directories (remove the comment below to include it)
+# vendor/
+
+# Go workspace file
+go.work
+
+# Go Fuzz build
+testdata/
+
+### Go Patch ###
+/vendor/
+/Godeps/
+
+### Intellij ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# AWS User-specific
+.idea/**/aws.xml
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn.  Uncomment if using
+# auto-import.
+# .idea/artifacts
+# .idea/compiler.xml
+# .idea/jarRepositories.xml
+# .idea/modules.xml
+# .idea/*.iml
+# .idea/modules
+# *.iml
+# *.ipr
+
+# CMake
+cmake-build-*/
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# SonarLint plugin
+.idea/sonarlint/
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+# Editor-based Rest Client
+.idea/httpRequests
+
+# Android studio 3.1+ serialized cache file
+.idea/caches/build_file_checksums.ser
+
+### Intellij Patch ###
+# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
+
+# *.iml
+# modules.xml
+# .idea/misc.xml
+# *.ipr
+
+# Sonarlint plugin
+# https://plugins.jetbrains.com/plugin/7973-sonarlint
+.idea/**/sonarlint/
+
+# SonarQube Plugin
+# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
+.idea/**/sonarIssues.xml
+
+# Markdown Navigator plugin
+# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
+.idea/**/markdown-navigator.xml
+.idea/**/markdown-navigator-enh.xml
+.idea/**/markdown-navigator/
+
+# Cache file creation bug
+# See https://youtrack.jetbrains.com/issue/JBR-2257
+.idea/$CACHE_FILE$
+
+# CodeStream plugin
+# https://plugins.jetbrains.com/plugin/12206-codestream
+.idea/codestream.xml
+
+# Azure Toolkit for IntelliJ plugin
+# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
+.idea/**/azureSettings.xml
+
+# End of https://www.toptal.com/developers/gitignore/api/intellij,go
\ No newline at end of file
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..13566b81b018ad684f3a35fee301741b2734c8f4
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/markdown.xml b/.idea/markdown.xml
new file mode 100644
index 0000000000000000000000000000000000000000..ec0b30fa7ea2824af6923493653e32595b0907a8
--- /dev/null
+++ b/.idea/markdown.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="MarkdownSettings">
+    <enabledExtensions>
+      <entry key="MermaidLanguageExtension" value="false" />
+      <entry key="PlantUMLLanguageExtension" value="true" />
+    </enabledExtensions>
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000000000000000000000000000000000000..639900d13c6182e452e33a3bd638e70a0146c785
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a215838bf9ec70f73e99d41985eb8ba51383160d
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/http-negotiation.iml" filepath="$PROJECT_DIR$/http-negotiation.iml" />
+    </modules>
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000000000000000000000000000000000000..35eb1ddfbbc029bcab630581847471d7f238ec53
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..93c01c0d042c2d12a35c45bad00f699935374b74
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,117 @@
+PROJECT_ROOT:=$(dir $(realpath $(lastword $(MAKEFILE_LIST))))
+THIS_MAKEFILE:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+THIS_MAKEFILE_PATH:=$(PROJECT_ROOT)$(THIS_MAKEFILE) 
+
+# @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
+.DEFAULT_GOAL := help
+
+.PHONY: print
+## Print Path	
+print:
+	@echo "THIS_MAKEFILE:      $(THIS_MAKEFILE)"
+	@echo "THIS_MAKEFILE_PATH: $(THIS_MAKEFILE_PATH)"
+	@echo "PROJECT_ROOT:       $(PROJECT_ROOT)"
+
+# Add a comment to the public targets so that it appears
+# in this help Use two # characters for a help comment
+.PHONY: help
+help:
+	@printf "${COMMENT}Usage:${RESET}\n"
+	@printf " make [target] [arg=\"val\"...]\n\n"
+	@printf "${COMMENT}Available targets:${RESET}\n"
+	@awk '/^[a-zA-Z\-\\_0-9\.@]+:/ { \
+		helpMessage = match(lastLine, /^## (.*)/); \
+		if (helpMessage) { \
+			helpCommand = substr($$1, 0, index($$1, ":")); \
+			helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
+			printf " ${INFO}%-22s${RESET} %s\n", helpCommand, helpMessage; \
+		} \
+	} \
+	{ lastLine = $$0 }' $(MAKEFILE_LIST)
+	@printf "\n${COMMENT}Available arguments:${RESET}\n\n"
+	@awk '/^(([a-zA-Z\-\\_0-9\.@]+)\s[?:]?=)/ { \
+		helpMessage = match(lastLine, /^## (.*)/); \
+		if (helpMessage) { \
+			helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
+			printf " ${INFO}%-22s${RESET} %s (Default: %s)\n", $$1, helpMessage, $$3; \
+		} \
+	} \
+	{ lastLine = $$0 }' $(MAKEFILE_LIST)
+
+
+## run tests
+test:
+	echo "Running tests"
+	go test -cover -v ./...
+
+## run tests with fuzzing
+test-fuzz:
+	echo "Running fuzz tests"
+	go test -v -fuzztime=30s -fuzz=Fuzz ./...
+
+#### VERSION
+BIN_DIR ?= $(shell echo $$HOME)/.local/bin/
+VERSION_NAME 	     := version
+EXECUTABLES = $(EXECUTABLES:-) $(VERSION_NAME)
+VERSION_BIN_PATH := $(BIN_DIR)$(VERSION_NAME)
+
+VERSION_BIN := $(shell command -v $(VERSION_NAME) 2> /dev/null)
+
+ifndef VERSION_BIN
+    $(shell curl -o $(VERSION_BIN_PATH) http://download.schukai.com/tools/version/version-$(shell uname -s | tr [:upper:] [:lower:])-$(shell echo `uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/`))
+    $(shell chmod +x $(VERSION_BIN_PATH))
+endif
+     
+RELEASE_FILE ?= $(PROJECT_ROOT)release.json
+ 
+ifeq ("$(wildcard $(RELEASE_FILE))","")
+  $(shell echo '{"version":"0.1.0"}' > $(RELEASE_FILE))
+endif
+
+PROJECT_VERSION ?= $(shell cat $(RELEASE_FILE) | jq -r .version)
+PROJECT_BUILD_DATE ?= $(shell $(VERSION_BIN) date)
+
+.PHONY: next-patch-version
+## create next patch version
+next-patch-version: check-clean-repo
+	echo "Creating next version"
+	$(VERSION_BIN) patch --path $(RELEASE_FILE) --selector "version"
+	git add $(RELEASE_FILE) && git commit -m "Bump version to $$(cat $(RELEASE_FILE) | jq -r .version)"
+
+.PHONY: next-minor-version
+## create next minor version
+next-minor-version: check-clean-repo
+	echo  "Creating next minor version"
+	$(VERSION_BIN) minor --path $(RELEASE_FILE) --selector "version"
+	git add $(RELEASE_FILE) && git commit -m "Bump version to $$( cat $(RELEASE_FILE) | jq -r .version)"
+
+.PHONY: next-major-version
+## create next major version
+next-major-version: check-clean-repo
+	echo "Creating next minor version"
+	$(VERSION_BIN) major --path $(RELEASE_FILE) --selector "version"
+	git add $(RELEASE_FILE) && git commit -m "Bump version to $$(cat $(RELEASE_FILE) | jq -r .version)"
+
+.PHONY: check-clean-repo
+check-clean-repo:
+	git diff-index --quiet HEAD || (echo "There are uncommitted changes after running make. Please commit or stash them before running make."; exit 1)
+	
+## tag repository with next patch version
+tag-patch-version: next-patch-version 
+	echo "Tagging patch version"
+	$(eval PROJECT_VERSION := $(shell cat $(RELEASE_FILE) | jq -r .version))
+	git tag -a v$(PROJECT_VERSION) -m "Version $(PROJECT_VERSION)"
+
+## tag repository with next minor version
+tag-minor-version: next-minor-version 
+	echo "Tagging minor version"
+	$(eval PROJECT_VERSION := $(shell cat $(RELEASE_FILE) | jq -r .version))
+	git tag -a v$(PROJECT_VERSION) -m "Version $(PROJECT_VERSION)"
+
+## tag repository with next major version
+tag-major-version: next-major-version 
+	echo "Tagging major version"
+	$(eval PROJECT_VERSION := $(shell cat $(RELEASE_FILE) | jq -r .version))
+	git tag -a v$(PROJECT_VERSION) -m "Version $(PROJECT_VERSION)"
+
+
diff --git a/README.md b/README.md
index 2273d27e3adf4db7ca8f32ad9a46b4a8f3f815ca..9de658b93e1a64127b20e68ccd60d0a72eb9735a 100644
--- a/README.md
+++ b/README.md
@@ -1,92 +1,54 @@
-# HTTP Negotiation
+## HTTP Negotiation
 
+## Installation
 
-
-## Getting started
-
-To make it easy for you to get started with GitLab, here's a list of recommended next steps.
-
-Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
-
-## Add your files
-
-- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
-
-```
-cd existing_repo
-git remote add origin https://gitlab.schukai.com/oss/libraries/go/application/http-negotiation.git
-git branch -M master
-git push -uf origin master
+```shell
+go get gitlab.schukai.com/oss/libraries/go/application/http-negotiation
 ```
 
-## Integrate with your tools
-
-- [ ] [Set up project integrations](https://gitlab.schukai.com/oss/libraries/go/application/http-negotiation/-/settings/integrations)
-
-## Collaborate with your team
+**Note:** This library uses [Go Modules](https://github.com/golang/go/wiki/Modules) to manage dependencies.
 
-- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
-- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
-- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
+## What do this library?
 
-## Test and Deploy
+This library provides a simple way to negotiate the content type of HTTP request.
 
-Use the built-in continuous integration in GitLab.
+It supports:
 
-- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
-- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
+* [x] [Content Negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation)
+* [x] [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language)
+* [x] [Accept-Charset](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Charset)
+* [x] [Accept-Encoding](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding)
 
-***
-
-# Editing this README
-
-When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
-
-## Suggestions for a good README
-Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
-
-## Name
-Choose a self-explaining name for your project.
-
-## Description
-Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
+## Usage
 
-## Badges
-On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
+```go
+package main
 
-## Visuals
-Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
+import (
+	"net/http"
+	"gitlab.schukai.com/oss/libraries/go/application/http-negotiation"
+)
 
-## Installation
-Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
+func handleRequest(w http.ResponseWriter, r *http.Request) {
+	n := negotiation.New(r.Header)
 
-## Usage
-Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
+	if n.Type("application/json") == "application/json" {
+		w.Header().Set("Content-Type", "application/json")
+		w.Write([]byte(`{"message": "Hello World!"}`))
+		return
+	}
 
-## Support
-Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
+}
 
-## Roadmap
-If you have ideas for releases in the future, it is a good idea to list them in the README.
+```
 
 ## Contributing
-State if you are open to contributions and what your requirements are for accepting them.
-
-For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
 
-You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
+Merge requests are welcome. For major changes, please open an issue first to discuss what 
+you would like to change.
 
-## Authors and acknowledgment
-Show your appreciation to those who have contributed to the project.
+Please make sure to update tests as appropriate.
 
 ## License
-For open source projects, say how it is licensed.
 
-## Project status
-If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
+[AGPL-3.0](https://choosealicense.com/licenses/agpl-3.0/)
\ No newline at end of file
diff --git a/api.go b/api.go
new file mode 100644
index 0000000000000000000000000000000000000000..8ae6596856ce7a85a333b14901d00a01f16baf08
--- /dev/null
+++ b/api.go
@@ -0,0 +1,43 @@
+package negotiation
+
+import (
+	"net/http"
+)
+
+// Negotiation represents the HTTP negotiator.
+type Negotiation struct {
+	header http.Header
+}
+
+// New creates an instance of Negotiation.
+func New(header http.Header) *Negotiation {
+	return &Negotiation{header}
+}
+
+// Type returns the most preferred content type from the HTTP Accept header.
+// If nothing accepted, then empty string is returned.
+func (n *Negotiation) Type(offers ...string) (bestOffer string) {
+	parser := newHeaderParser(n.header, true)
+	return parser.selectOffer(offers, parser.parse(headerAccept))
+}
+
+// Language returns the most preferred language from the HTTP Accept-Language
+// header. If nothing accepted, then empty string is returned.
+func (n *Negotiation) Language(offers ...string) (bestOffer string) {
+	parser := newHeaderParser(n.header, false)
+	return parser.selectOffer(offers, parser.parse(headerAcceptLanguage))
+}
+
+// Encoding returns the most preferred encoding from the HTTP Accept-Encoding
+// header. If nothing accepted, then empty string is returned.
+func (n *Negotiation) Encoding(offers ...string) (bestOffer string) {
+	parser := newHeaderParser(n.header, false)
+	return parser.selectOffer(offers, parser.parse(headerAcceptEncoding))
+}
+
+// Charset returns the most preferred charset from the HTTP Accept-Charset
+// header. If nothing accepted, then empty string is returned.
+func (n *Negotiation) Charset(offers ...string) (bestOffer string) {
+	parser := newHeaderParser(n.header, false)
+	return parser.selectOffer(offers, parser.parse(headerAcceptCharset))
+}
diff --git a/api_test.go b/api_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..a976912a50030b6c29848dbe973b8efe13ae834f
--- /dev/null
+++ b/api_test.go
@@ -0,0 +1,88 @@
+package negotiation
+
+import (
+	"net/http"
+	"testing"
+)
+
+func TestNegotiationLanguage(t *testing.T) {
+
+	req, err := http.NewRequest("GET", "/", nil)
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	req.Header.Set("Accept-Language", "en-US;q=0.8, en;q=0.7")
+
+	n := New(req.Header)
+
+	if n.Language("en-GB", "en") != "en" {
+		t.Errorf("accepted locale should be %v, got %v", "en", "en-GB")
+	}
+
+	if n.Language("en-GB") != "" {
+		t.Errorf("there should be no accepted locale, got %v", n.Language("en-GB"))
+	}
+
+	if n.Language("en-US") != "en-US" {
+		t.Errorf("accepted locale should be %v, got %v", "en-US", "en-GB")
+	}
+
+}
+
+func TestNegotiationCharset(t *testing.T) {
+
+	req, err := http.NewRequest("GET", "/config", nil)
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	req.Header.Set("Accept-Charset", "utf-8")
+
+	n := New(req.Header)
+
+	if n.Charset("utf-8") != "utf-8" {
+		t.Errorf("accepted charset should be %v, got %v", "utf-8", "utf-8")
+	}
+
+}
+
+func TestNegotiationEncoding(t *testing.T) {
+
+	req, err := http.NewRequest("GET", "/", nil)
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	req.Header.Set("Accept-Encoding", "gzip")
+
+	n := New(req.Header)
+
+	if n.Encoding("gzip") != "gzip" {
+		t.Errorf("accepted encoding should be %v, got %v", "gzip", "gzip")
+	}
+
+}
+
+func TestNegotiationType(t *testing.T) {
+
+	req, err := http.NewRequest("GET", "/", nil)
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	req.Header.Set("Accept", "application/yaml")
+
+	n := New(req.Header)
+
+	if n.Type("application/json") != "" {
+		t.Errorf("handler returned wrong status code: got %v want %v",
+			n.Type("application/json"), "application/yaml")
+	}
+
+	if n.Type("application/yaml") != "application/yaml" {
+		t.Errorf("handler returned wrong status code: got %v want %v",
+			n.Type("application/yaml"), "application/yaml")
+	}
+
+}
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000000000000000000000000000000000000..b375729eea691f4227a0d3770e63206d97e7f8ea
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,3 @@
+module gitlab.schukai.com/oss/libraries/go/application/http-negotiation
+
+go 1.19
diff --git a/header.go b/header.go
new file mode 100644
index 0000000000000000000000000000000000000000..c651276e5f39d482ce703b11ff833a260942f155
--- /dev/null
+++ b/header.go
@@ -0,0 +1,8 @@
+package negotiation
+
+const (
+	headerAccept         = "Accept"
+	headerAcceptLanguage = "Accept-Language"
+	headerAcceptEncoding = "Accept-Encoding"
+	headerAcceptCharset  = "Accept-Charset"
+)
diff --git a/http-negotiation.iml b/http-negotiation.iml
new file mode 100644
index 0000000000000000000000000000000000000000..0d0e769e614cd150a47c469a4bc9dc999540cc9b
--- /dev/null
+++ b/http-negotiation.iml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="Go" enabled="true" />
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <excludeFolder url="file://$MODULE_DIR$/testdata" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>
\ No newline at end of file
diff --git a/parser.go b/parser.go
new file mode 100644
index 0000000000000000000000000000000000000000..9c528714751ef94ee2b31475722808d473457a58
--- /dev/null
+++ b/parser.go
@@ -0,0 +1,138 @@
+package negotiation
+
+import (
+	"net/http"
+	"sort"
+	"strconv"
+	"strings"
+)
+
+type headerParser struct {
+	header      http.Header
+	hasSlashVal bool
+	defaultQ    float64
+	wildCard    string
+}
+
+func newHeaderParser(header http.Header, hasSlashVal bool) *headerParser {
+	hp := &headerParser{header: header, hasSlashVal: hasSlashVal, defaultQ: 1.0}
+
+	if hp.hasSlashVal {
+		hp.wildCard = "*/*"
+	} else {
+		hp.wildCard = "*"
+	}
+
+	return hp
+}
+
+func (p headerParser) parse(headerName string) specs {
+	headerVal := formatHeaderVal(p.header.Get(headerName))
+
+	specs := make(specs, 0, 10)
+
+	if headerVal == "" {
+		specs = []spec{spec{val: p.wildCard, q: p.defaultQ}}
+		return specs
+	}
+
+	for _, accept := range strings.Split(headerVal, ",") {
+		pair := strings.Split(strings.TrimSpace(accept), ";")
+
+		if len(pair) < 1 || len(pair) > 2 {
+			if p.hasSlashVal {
+				if strings.Index(pair[0], "/") == -1 {
+					continue
+				}
+			} else {
+				continue
+			}
+		}
+
+		spec := spec{val: pair[0], q: p.defaultQ}
+
+		if len(pair) == 2 {
+			var i int
+
+			if strings.HasPrefix(pair[1], "q=") {
+				i = 2
+			} else if strings.HasPrefix(pair[1], "level=") {
+				i = 6
+			} else {
+				continue
+			}
+
+			if q, err := strconv.ParseFloat(pair[1][i:], 64); err == nil && q != 0.0 {
+				if q > p.defaultQ {
+					q = p.defaultQ
+				}
+
+				spec.q = q
+			} else {
+				continue
+			}
+		}
+
+		specs = append(specs, spec)
+	}
+
+	sort.Sort(specs)
+
+	return specs
+}
+
+func (p headerParser) selectOffer(offers []string, specs specs) string {
+	bestQ := 0.0
+	bestOffer := ""
+
+	var bestWild, totalWild int
+	if p.hasSlashVal {
+		bestWild, totalWild = 3, 3
+	} else {
+		bestWild, totalWild = 2, 2
+	}
+
+	if len(specs) == 0 {
+		return bestOffer
+	}
+
+	if len(offers) == 0 {
+		return specs[0].val
+	}
+
+	for _, offer := range offers {
+		lowerCaseOffer := strings.ToLower(offer)
+
+		for _, spec := range specs {
+			switch {
+			case spec.q <= bestQ:
+				continue
+			case spec.val == p.wildCard && !specs.hasVal(lowerCaseOffer):
+				if spec.q > bestQ || bestWild > totalWild-1 {
+					bestOffer = offer
+
+					bestQ, bestWild = spec.q, totalWild-1
+				}
+			case p.hasSlashVal && strings.HasSuffix(spec.val, "/*"):
+				if strings.HasPrefix(lowerCaseOffer, spec.val[:len(spec.val)-1]) &&
+					(spec.q > bestQ || bestWild > totalWild-2) {
+					bestOffer = offer
+
+					bestQ, bestWild = spec.q, totalWild-2
+				}
+			case spec.val == lowerCaseOffer:
+				if spec.q > bestQ || bestWild > 0 {
+					bestOffer = offer
+
+					bestQ, bestWild = spec.q, 0
+				}
+			}
+		}
+	}
+
+	return bestOffer
+}
+
+func formatHeaderVal(val string) string {
+	return strings.ToLower(strings.Replace(val, " ", "", -1))
+}
diff --git a/parser_test.go b/parser_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..5725b3728c8adba11c03a779ee017f9a74c34bc8
--- /dev/null
+++ b/parser_test.go
@@ -0,0 +1,47 @@
+package negotiation
+
+import (
+	"net/http"
+	"testing"
+)
+
+func TestParser(t *testing.T) {
+	p := newHeaderParser(nil, false)
+	if p.wildCard != "*" {
+		t.Errorf("wildCard should be '*', but is %s", p.wildCard)
+	}
+}
+
+func TestParserSlash(t *testing.T) {
+	p := newHeaderParser(nil, true)
+	if p.wildCard != "*/*" {
+		t.Errorf("wildCard should be '*/*', but is %s", p.wildCard)
+	}
+}
+
+func TestParserSlash2(t *testing.T) {
+	p := newHeaderParser(nil, false)
+	if p.wildCard != "*" {
+		t.Errorf("wildCard should be '*', but is %s", p.wildCard)
+	}
+}
+
+func FuzzTestParser(f *testing.F) {
+
+	f.Fuzz(func(t *testing.T, acceptString, a, b string) {
+
+		req, err := http.NewRequest("Get", "/", nil)
+		if err != nil {
+			t.Fatal(err)
+		}
+
+		req.Header.Set("Accept", acceptString)
+
+		p := newHeaderParser(req.Header, false)
+		spec := p.parse("Accept")
+		if spec == nil {
+			t.Errorf("spec should not be nil")
+		}
+
+	})
+}
diff --git a/release.json b/release.json
new file mode 100644
index 0000000000000000000000000000000000000000..d2bad7dcaebc46331fc002036758c7447c0b679a
--- /dev/null
+++ b/release.json
@@ -0,0 +1 @@
+{"version":"0.1.0"}
diff --git a/spec.go b/spec.go
new file mode 100644
index 0000000000000000000000000000000000000000..c4633ec65bf1ee388c41e7a6a2f5021a76b78b09
--- /dev/null
+++ b/spec.go
@@ -0,0 +1,51 @@
+package negotiation
+
+import "strings"
+
+type spec struct {
+	val string
+	q   float64
+}
+
+// specs represents []spec
+type specs []spec
+
+// Len is to implement sort.Interface for Specs.
+func (s specs) Len() int {
+	return len(s)
+}
+
+// Swap is to implement sort.Interface for Specs.
+func (s specs) Swap(i, j int) {
+	s[i], s[j] = s[j], s[i]
+}
+
+// Less is to implement sort.Interface for Specs.
+func (s specs) Less(i, j int) bool {
+	if s[i].q > s[j].q {
+		return true
+	}
+	if s[i].q == s[j].q {
+		if s[i].val == "*" || strings.HasSuffix(s[i].val, "/*") {
+			return true
+		}
+
+		if s[j].val == "*" || strings.HasSuffix(s[j].val, "/*") {
+			return false
+		}
+
+		return i < j
+	}
+
+	return false
+}
+
+func (s specs) hasVal(val string) bool {
+	for _, spec := range s {
+		if spec.val == val {
+			return true
+		}
+	}
+
+	return false
+}
diff --git a/spec_test.go b/spec_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..d66e6284aca4353d02e02c25ebaec9e7eb2251b3
--- /dev/null
+++ b/spec_test.go
@@ -0,0 +1,52 @@
+package negotiation
+
+import (
+	"sort"
+	"testing"
+)
+
+func TestSpec(t *testing.T) {
+
+	s := specs{
+		spec{val: "text/plain", q: 0.9},
+		spec{val: "text/html", q: 1.0},
+		spec{val: "text/*", q: 0.7},
+		spec{val: "text/*", q: 0.8},
+	}
+
+	sort.Sort(s)
+
+	if s[0].val != "text/html" {
+		t.Errorf("Expected text/html, got %s", s[0].val)
+	}
+
+	if s[1].val != "text/plain" {
+		t.Errorf("Expected text/plain, got %s", s[1].val)
+	}
+
+	if s[2].val != "text/*" {
+		t.Errorf("Expected text/*, got %s", s[2].val)
+	}
+
+	if s[3].val != "text/*" {
+		t.Errorf("Expected text/*, got %s", s[3].val)
+	}
+}
+
+func TestHasValue(t *testing.T) {
+
+	s := specs{
+		spec{val: "text/plain", q: 0.9},
+		spec{val: "text/html", q: 1.0},
+		spec{val: "text/*", q: 0.7},
+		spec{val: "text/*", q: 0.8},
+	}
+
+	if !s.hasVal("text/plain") {
+		t.Errorf("Expected true, got false")
+	}
+
+	if s.hasVal("text/xml") {
+		t.Errorf("Expected false, got true")
+	}
+}