{"id":37791361,"url":"https://github.com/georlav/httprawmock","last_synced_at":"2026-01-16T15:17:01.398Z","repository":{"id":45877822,"uuid":"430102836","full_name":"georlav/httprawmock","owner":"georlav","description":"A simple http test server which allow the use of raw http response data for easy mocking APIs and web services. Create end-to-end tests for your http client by setting your own routes using custom patterns and a stub for each.","archived":false,"fork":false,"pushed_at":"2021-11-30T12:06:51.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-07-27T22:08:01.378Z","etag":null,"topics":["go","golang","http-client","httpmock","mock-server","raw-http","testing"],"latest_commit_sha":null,"homepage":"","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/georlav.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}},"created_at":"2021-11-20T12:55:06.000Z","updated_at":"2021-12-01T19:30:49.000Z","dependencies_parsed_at":"2022-09-05T05:20:34.472Z","dependency_job_id":null,"html_url":"https://github.com/georlav/httprawmock","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"purl":"pkg:github/georlav/httprawmock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georlav%2Fhttprawmock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georlav%2Fhttprawmock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georlav%2Fhttprawmock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georlav%2Fhttprawmock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/georlav","download_url":"https://codeload.github.com/georlav/httprawmock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georlav%2Fhttprawmock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: 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":["go","golang","http-client","httpmock","mock-server","raw-http","testing"],"created_at":"2026-01-16T15:17:01.264Z","updated_at":"2026-01-16T15:17:01.383Z","avatar_url":"https://github.com/georlav.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![godoc](https://img.shields.io/badge/godoc-reference-5272B4.svg)](https://pkg.go.dev/github.com/georlav/httprawmock)\n[![Tests](https://github.com/georlav/httprawmock/actions/workflows/ci.yml/badge.svg)](https://github.com/georlav/httprawmock/actions/workflows/ci.yml)\n[![Golang-CI](https://github.com/georlav/httprawmock/actions/workflows/linter.yml/badge.svg)](https://github.com/georlav/httprawmock/actions/workflows/linter.yml)\n\n# httprawmock\nA simple http test server which allow the use of raw http response data for easy mocking APIs and web services. Create end-to-end tests for your http client by setting your own routes using custom patterns and a stub for each.\n\n## Examples\nPlease check the [examples_test.go](examples_test.go) file for some basic usage examples. Also check some  basic examples from [another project](https://github.com/georlav/bitstamp/blob/master/httpapi_test.go) that uses httprawmock and table driven tests.\n```go\n    response := `HTTP/1.1 200 OK\nServer: nginx/1.14.2\nDate: Sat, 20 Nov 2021 13:39:23 GMT\nContent-Type: application/json; charset=utf-8\nTransfer-Encoding: chunked\nConnection: keep-alive\nAccess-Control-Allow-Origin: *\nAccess-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS\nAccess-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range\nAccess-Control-Expose-Headers: Content-Length,Content-Range\n\n{\"_id\":\"6198f9da97069d03e849096d\",\"name\":\"Sparkle Angel\",\"age\":2,\"colour\":\"blue\"}`\n\n    // Register your routes\n\tts := httprawmock.NewServer(\n\t\thttprawmock.NewRoute(http.MethodGet, \"/unicorns/{id}\", []byte(response)),\n\t)\n\tdefer ts.Close()\n\n    resp, err := http.DefaultClient.Get(ts.URL + \"/unicorns/6198f9da97069d03e849096d\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n    b, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Println(string(b))\n```\n\n## Install\n```bash\ngo get github.com/georlav/httprawmock@latest\n```\n\n## Running tests\nTo run tests use\n```go\ngo test -race ./... -v\n```\n\n## License\nDistributed under the MIT License. See `LICENSE` for more information.\n\n## Contact\nGeorge Lavdanis - georlav@gmail.com\n\nProject Link: [https://github.com/georlav/httprawmock](https://github.com/georlav/httprawmock)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorlav%2Fhttprawmock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorlav%2Fhttprawmock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorlav%2Fhttprawmock/lists"}