{"id":48680785,"url":"https://github.com/Vatavuk/verano-http","last_synced_at":"2026-04-26T20:00:40.705Z","repository":{"id":41493405,"uuid":"171885205","full_name":"Vatavuk/verano-http","owner":"Vatavuk","description":"Java HTTP Client in OOP style","archived":false,"fork":false,"pushed_at":"2023-03-07T19:38:47.000Z","size":342,"stargazers_count":54,"open_issues_count":12,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-22T22:21:52.065Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","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/Vatavuk.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}},"created_at":"2019-02-21T14:20:10.000Z","updated_at":"2025-11-14T16:08:11.000Z","dependencies_parsed_at":"2023-02-16T01:31:24.910Z","dependency_job_id":"1e91c437-3021-4cb8-837e-4b831a8bf5db","html_url":"https://github.com/Vatavuk/verano-http","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/Vatavuk/verano-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vatavuk%2Fverano-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vatavuk%2Fverano-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vatavuk%2Fverano-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vatavuk%2Fverano-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vatavuk","download_url":"https://codeload.github.com/Vatavuk/verano-http/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vatavuk%2Fverano-http/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32310804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T19:15:34.056Z","status":"ssl_error","status_checked_at":"2026-04-26T19:15:15.467Z","response_time":129,"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":[],"created_at":"2026-04-11T01:00:36.064Z","updated_at":"2026-04-26T20:00:40.695Z","avatar_url":"https://github.com/Vatavuk.png","language":"Java","funding_links":[],"categories":["网络编程"],"sub_categories":["Spring Cloud框架"],"readme":"\u003cimg src=\"logo.png\" alt=\"drawing\" height=\"100\"/\u003e\n\n[![EO principles respected here](http://www.elegantobjects.org/badge.svg)](http://www.elegantobjects.org)\n[![DevOps By Rultor.com](http://www.rultor.com/b/Vatavuk/verano-http)](http://www.rultor.com/p/Vatavuk/verano-http)\n\n[![Build Status](https://travis-ci.org/Vatavuk/verano-http.svg?branch=master)](https://travis-ci.org/Vatavuk/verano-http)\n[![Test Coverage](https://codecov.io/gh/Vatavuk/verano-http/branch/master/graph/badge.svg)](https://codecov.io/gh/Vatavuk/verano-http)\n[![Hits-of-Code](https://hitsofcode.com/github/Vatavuk/verano-http)](https://hitsofcode.com/view/github/Vatavuk/verano-http)\n[![SonarQube](https://img.shields.io/badge/sonar-ok-green.svg)](https://sonarcloud.io/dashboard/index/hr.com.vgv.verano:verano-http)\n\n[![Javadocs](http://javadoc.io/badge/hr.com.vgv.verano/verano-http.svg)](http://javadoc.io/doc/hr.com.vgv.verano/verano-http)\n[![Maven Central](https://img.shields.io/maven-central/v/hr.com.vgv.verano/verano-http.svg)](https://maven-badges.herokuapp.com/maven-central/hr.com.vgv.verano/verano-http)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/Vatavuk/verano-http/blob/master/LICENSE.txt)\n\n\nHTTP client that provides object-oriented interface for building HTTP requests. \nThe benefits of this library are that it is easily customizable, declarative and immutable.\nIt can also be [tested](#testing) without mock servers which gives a performance edge.\n\nSimilar libraries: [cactoos-http](https://github.com/yegor256/cactoos-http), [jcabi-http](https://github.com/jcabi/jcabi-http)\n\nC# port of the library: [Yaapii.Http](https://github.com/icarus-consulting/Yaapii.Http) ([icarus-consulting](https://github.com/icarus-consulting))\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ehr.com.vgv.verano\u003c/groupId\u003e\n    \u003cartifactId\u003everano-http\u003c/artifactId\u003e\n    \u003cversion\u003e1.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Get a Url\n```java\nJsonObject json = new JsonBody.Of(\n    new Response(\n        \"http://example.com\",\n        new Get(\n            \"/items\",\n            new QueryParam(\"name\", \"John\"),\n            new Accept(\"application/json\")\n        )\n    )\n).json();\n```\n\n## Post to a Server\n```java\nnew Response(\n    \"http://example.com\",\n    new Post(\n        \"/items\",\n        new Body(\"Hello World!\"),\n        new ContentType(\"text/html\"),\n    )\n).touch();\n```\n`Touch` method executes the `HTTP` request towards the server.\n\nUsing form parameters:\n```java\nnew Response(\n    \"http://example.com\",\n    new Post(\n        \"/items\",\n        new FormParam(\"name\",\"John\"),\n        new FormParam(\"foo\",\"bar\"),\n    )\n).touch();\n```\n\n## Response handling\nExtraction of response parameters can be done using `*.Of` classes:\n```java\nResponse response = new Response(\n    \"http://example.com\",\n    new Get(\"/items\")\n);\nMap\u003cString, List\u003cString\u003e\u003e headers = new Headers.Of(response).asMap(); // Extraction of headers from response\nString cookie = new Cookie.Of(\"cookieName\", response).asString();\nString body = new Body.Of(response).asString();\n```\n\nYou can make assertions on received responses like this:\n```java\nnew Response(\n    \"http://exmpl.com\",\n    new Get(\"/items\"),\n    new ExpectedStatus(\n        200, \n        new FailWith(\"Cannot fetch from exmpl\")\n    )\n).touch();\n```\n\n## Serialization and Deserialization\nThe library provides following types of request body serialization:\n- [JsonBody](https://github.com/Vatavuk/verano-http/blob/master/src/main/java/hr/com/vgv/verano/http/parts/body/JsonBody.java#L42) - javax.json\n- [XmlBody](https://github.com/Vatavuk/verano-http/blob/master/src/main/java/hr/com/vgv/verano/http/parts/body/XmlBody.java#37)  - [jcabi-xml](https://github.com/jcabi/jcabi-xml)\n- [DtoBody](https://github.com/Vatavuk/verano-http/blob/master/src/main/java/hr/com/vgv/verano/http/parts/body/DtoBody.java#37)  - jackson object mapper\n- [HtmlBody](https://github.com/Vatavuk/verano-http/blob/master/src/main/java/hr/com/vgv/verano/http/parts/body/HtmlBody.java#37) - [jsoup](https://github.com/jhy/jsoup)\n\nResponse body deserialization can be achieved using their accompanied `*.Of` classes.\n\n## Wire\nVerano-http runs on `ApacheWire` which encapsulates [Apache http client](https://github.com/apache/httpcomponents-client).\nYou can provide additional configuration to the wire:\n```java\nWire wire = new ApacheWire(\n    \"http://exmpl.com\",\n    new Proxy(\"127.0.0.1\", 8000),\n    new SslTrusted()\n);\nnew Response(\n    wire, new Get(\"/items\")\n).touch();\n```\nYou can also provide http parameters to the wire:\n```java\nnew Response(\n    new ApacheWire(\n        \"http://exmpl.com\", \n        new ContentType(\"application/json\"),\n        new Header(\"foo\", \"bar\"),\n    ),\n    new Get(\"/items\")\n).touch();\n```\n\n## Testing\nHttp requests can be tested through `MockWire` without using a http server.\n`MockWire` works in conjunction with [hamcrest matchers](http://hamcrest.org/JavaHamcrest/) in a following way:\n```java\nMockWire wire = new MockWire(\n    new MockAnswer(\n        new PathMatch(MatchesPattern.matchesPattern(\"/.*\")),\n        new Response(new Status(201))\n    )\n);\nsendRequest(wire);\nwire.verify(\n    new PostMatch(\n        new PathMatch(new IsEqual\u003c\u003e(\"/items\")),\n        new BodyMatch(new StringContains(\"text\"))\n    )\n);\n```\n\n## Contribution\nYou can contribute by forking the repo and sending a pull request.\nMake sure your branch builds without any warnings/issues:\n\n```\nmvn clean install -Pqulice\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVatavuk%2Fverano-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVatavuk%2Fverano-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVatavuk%2Fverano-http/lists"}