{"id":16788572,"url":"https://github.com/mna/httpparms","last_synced_at":"2026-03-09T21:05:05.435Z","repository":{"id":57494604,"uuid":"64035155","full_name":"mna/httpparms","owner":"mna","description":"Package httpparms provides helper functions and mechanisms to load the content of an HTTP request into a Go struct.","archived":false,"fork":false,"pushed_at":"2023-09-22T15:14:15.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-18T04:05:03.001Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mna.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-23T20:35:58.000Z","updated_at":"2023-09-22T15:14:20.000Z","dependencies_parsed_at":"2024-06-19T05:19:35.447Z","dependency_job_id":"c5e65d49-4e54-421b-b78f-5dd77bc6f47f","html_url":"https://github.com/mna/httpparms","commit_stats":null,"previous_names":["puerkitobio/httpparms"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mna/httpparms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mna%2Fhttpparms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mna%2Fhttpparms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mna%2Fhttpparms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mna%2Fhttpparms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mna","download_url":"https://codeload.github.com/mna/httpparms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mna%2Fhttpparms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30312149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-13T08:18:19.672Z","updated_at":"2026-03-09T21:05:05.420Z","avatar_url":"https://github.com/mna.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# httpparms [![GoDoc](https://godoc.org/github.com/PuerkitoBio/httpparms?status.png)][godoc] [![Build Status](https://semaphoreci.com/api/v1/mna/httpparms/branches/master/badge.svg)](https://semaphoreci.com/mna/httpparms)\n\nPackage httpparms provides helper functions and types to load the content of an HTTP request into a Go struct. It supports loading the query string parameters, the form-encoded body and the JSON-encoded body. If the struct implements the `Validator` interface, it also validates the values.\n\nSee the [godoc][] for full documentation.\n\n## Installation\n\n```\n$ go get github.com/PuerkitoBio/httpparms\n```\n\nUse `-u` to update, `-t` to install test dependencies.\n\n## Example\n\n```\ntype parmTest struct {\n\tS string\n\tI int    `schema:\"-\"`\n\tQ string `schema:\"q\" json:\"q_value\"`\n}\n\nfunc (pt *parmTest) Validate() error {\n    if pt.S == \"\" {\n        return errors.New(\"parameter `s` is required\")\n    }\n\tif pt.I \u003e 2 {\n\t\treturn errors.New(\"parameter `i` is too big\")\n\t}\n\treturn nil\n}\n\nvar parser = \u0026httpparms.Parser{\n    // use github.com/gorilla/schema as form decoder\n    Form: schema.NewDecoder().Decode,\n}\n\nfunc myHandler(w http.ResponseWriter, r *http.Request) {\n    var pt parmTest\n    if err := parser.ParseQueryJSON(r, \u0026pt); err != nil {\n        // Optionally get the parameter names in error with\n        // parms := parser.ParametersFromErr(err)\n        // and use this in the error message.\n        http.Error(w, err.Error(), http.StatusBadRequest)\n        return\n    }\n    // process the request with valid parameters...\n}\n```\n\n## License\n\nThe [BSD 3-clause][bsd] license, see LICENSE file.\n\n[bsd]: http://opensource.org/licenses/BSD-3-Clause\n[godoc]: http://godoc.org/github.com/PuerkitoBio/httpparms\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmna%2Fhttpparms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmna%2Fhttpparms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmna%2Fhttpparms/lists"}