{"id":19589083,"url":"https://github.com/rdf-elixir/content_type","last_synced_at":"2026-06-18T05:31:43.621Z","repository":{"id":57485690,"uuid":"123734273","full_name":"rdf-elixir/content_type","owner":"rdf-elixir","description":"An Elixir parser for HTTP Content-Type headers","archived":false,"fork":false,"pushed_at":"2021-12-05T23:17:25.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-06T00:12:44.526Z","etag":null,"topics":["content-type","elixir","http","parser"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/content_type","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rdf-elixir.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-03T21:48:16.000Z","updated_at":"2021-12-05T23:17:27.000Z","dependencies_parsed_at":"2022-09-04T04:10:54.686Z","dependency_job_id":null,"html_url":"https://github.com/rdf-elixir/content_type","commit_stats":null,"previous_names":["marcelotto/content_type"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rdf-elixir/content_type","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdf-elixir%2Fcontent_type","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdf-elixir%2Fcontent_type/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdf-elixir%2Fcontent_type/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdf-elixir%2Fcontent_type/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rdf-elixir","download_url":"https://codeload.github.com/rdf-elixir/content_type/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdf-elixir%2Fcontent_type/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34478105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["content-type","elixir","http","parser"],"created_at":"2024-11-11T08:17:03.533Z","updated_at":"2026-06-18T05:31:43.602Z","avatar_url":"https://github.com/rdf-elixir.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ContentType\n\n[![CI](https://github.com/rdf-elixir/content_type/workflows/CI/badge.svg?branch=master)](https://github.com/rdf-elixir/content_type/actions?query=branch%3Amaster+workflow%3ACI)\n[![Hex.pm](https://img.shields.io/hexpm/v/content_type.svg?style=flat-square)](https://hex.pm/packages/content_type)\n\n\nA pure Elixir parser for HTTP Content-Type headers.\n\nIt's an extraction from [Plug](https://github.com/elixir-plug/plug) by Plataformatec.\n\n\n## Installation\n\nAdd `content_type` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:content_type, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n\n## Usage\n\nParsing a content type:\n\n```elixir\nimport ContentType\n\ncontent_type \"text/plain\"                        \n# =\u003e {:ok, \"text\", \"plain\", %{}}\n\ncontent_type \"x-sample/json; charset=utf-8\" \n# =\u003e {:ok, \"x-sample\", \"json\", %{\"charset\" =\u003e \"utf-8\"}}\n\ncontent_type \"APPLICATION/vnd.ms-data+XML\"\n# =\u003e {:ok, \"application\", \"vnd.ms-data+xml\", %{}}\n\ncontent_type \"x/*\"\n# =\u003e :error\n```\n\nParsing a media type (with potential wildcards):\n\n```elixir\nimport ContentType\n\nmedia_type \"x/*\"\n# =\u003e {:ok, \"x\", \"*\", %{}}\n\nmedia_type \"text/*; q=1.0\"\n# =\u003e {:ok, \"text\", \"*\", %{\"q\" =\u003e \"1.0\"}}\n\nmedia_type \"x y\"\n# =\u003e :error\n```\n\n\n## License\n\nThe source code is released under Apache 2 License.\nCheck LICENSE file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdf-elixir%2Fcontent_type","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frdf-elixir%2Fcontent_type","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdf-elixir%2Fcontent_type/lists"}