{"id":22506412,"url":"https://github.com/a-poor/vhttp","last_synced_at":"2025-03-27T23:40:51.351Z","repository":{"id":57748785,"uuid":"523756340","full_name":"a-poor/vhttp","owner":"a-poor","description":"A library for testing Go HTTP requests and responses from the net/http package.","archived":false,"fork":false,"pushed_at":"2023-02-28T00:30:55.000Z","size":42,"stargazers_count":2,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T06:36:00.234Z","etag":null,"topics":["go","hacktoberfest","http","testing"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/a-poor/vhttp","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a-poor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2022-08-11T14:33:41.000Z","updated_at":"2023-02-14T11:43:58.000Z","dependencies_parsed_at":"2024-06-20T12:59:15.964Z","dependency_job_id":"0b3c0bf4-0e12-4387-93ce-5b58e094fa20","html_url":"https://github.com/a-poor/vhttp","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-poor%2Fvhttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-poor%2Fvhttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-poor%2Fvhttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-poor%2Fvhttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a-poor","download_url":"https://codeload.github.com/a-poor/vhttp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245944060,"owners_count":20697946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["go","hacktoberfest","http","testing"],"created_at":"2024-12-07T00:43:38.914Z","updated_at":"2025-03-27T23:40:51.330Z","avatar_url":"https://github.com/a-poor.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vhttp\n\n[![Go Test](https://github.com/a-poor/vhttp/actions/workflows/go-test.yml/badge.svg)](https://github.com/a-poor/vhttp/actions/workflows/go-test.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/a-poor/vhttp.svg)](https://pkg.go.dev/github.com/a-poor/vhttp)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/a-poor/vhttp)\n[![Go Report Card](https://goreportcard.com/badge/github.com/a-poor/vhttp)](https://goreportcard.com/report/github.com/a-poor/vhttp)\n[![Coverage Status](https://coveralls.io/repos/github/a-poor/vhttp/badge.svg?branch=main)](https://coveralls.io/github/a-poor/vhttp?branch=main)\n\n_created by Austin Poor_\n\nA library for validating HTTP requests and responses from the `net/http` package.\n\n## Quick Example\n\nThe following is a quick example testing that `req` (of type `*http.Request`)...\n1. Is a \"GET\" request\n2. Calling `json.Valid()` on the body returns true\n3. Has the header \"Content-Type\" and it's equal to \"application/json\"\n4. The header \"Authorization\" matches the regular expression `^Bearer .+$`\n5. Has the URL path \"/users/all\"\n\n```go\nerr := vhttp.ValidateRequest(req, \n    vhttp.MethodIsGet(),                      // #1\n    vhttp.BodyIsValidJSON(),                  // #2\n    vhttp.HeaderContentTypeJSON(),            // #3\n    vhttp.HeaderAuthorizationMatchesBearer(), // #4\n    vhttp.URLPathIs(\"/users/all\"),            // #5\n)\n```\n\nRead more and find more examples in the [go docs](https://pkg.go.dev/github.com/a-poor/vhttp)!\n\n## License\n\n`vhttp` is released under an [MIT license](./LICENSE.txt).\n\n## Contributing\n\nContributions are welcome! \n\nPlease feel free to submit an issue or a PR. Or you can reach out to me on [mastodon](https://mastodon.social/@austinpoor).\n\n## To-Do\n\n- Add more tests!\n- Add more examples!\n- Form validators\n- Check for `nil` pointers? (eg `*url.URL`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-poor%2Fvhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-poor%2Fvhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-poor%2Fvhttp/lists"}