{"id":20555524,"url":"https://github.com/thewaterfall/fluent-request","last_synced_at":"2026-01-22T12:56:35.283Z","repository":{"id":207177973,"uuid":"718610995","full_name":"thewaterfall/fluent-request","owner":"thewaterfall","description":"Fluent Request is a Java library designed to simplify and streamline the process of making HTTP requests. It follows a fluent builder pattern, allowing users to construct complex HTTP requests in a readable and expressive manner","archived":false,"fork":false,"pushed_at":"2024-08-14T11:40:42.000Z","size":95,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T12:56:56.608Z","etag":null,"topics":["http","http-client","java","java-http-client","java-http-request","request","request-builder"],"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/thewaterfall.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":"2023-11-14T12:53:50.000Z","updated_at":"2025-04-07T16:48:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"177f8f93-92e4-4f05-808a-b41e478fb819","html_url":"https://github.com/thewaterfall/fluent-request","commit_stats":null,"previous_names":["thewaterfall/fluent-request"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/thewaterfall/fluent-request","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thewaterfall%2Ffluent-request","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thewaterfall%2Ffluent-request/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thewaterfall%2Ffluent-request/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thewaterfall%2Ffluent-request/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thewaterfall","download_url":"https://codeload.github.com/thewaterfall/fluent-request/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thewaterfall%2Ffluent-request/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28663769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"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":["http","http-client","java","java-http-client","java-http-request","request","request-builder"],"created_at":"2024-11-16T03:18:53.456Z","updated_at":"2026-01-22T12:56:35.264Z","avatar_url":"https://github.com/thewaterfall.png","language":"Java","readme":"# Fluent Request\n\nFluent Request is a powerful and flexible Java library for constructing HTTP requests in a fluent and expressive manner. It simplifies the process of creating and sending HTTP requests by providing a chainable API for building requests with ease.\n\n## Features\n\n- Clean, readable and fluent syntax.\n- Customizable request parameters and headers.\n- Support various HTTP methods, including GET, POST, PUT, DELETE, and more.\n- Support for JSON, multipart, form data, and other content types.\n- [OkHttp](https://github.com/square/okhttp) library as the base HTTP client\n- [Jackson](https://github.com/FasterXML/jackson) library as JSON parser to return expected response\n\n## Installation\nFluent Request can be easily installed using JitPack, see Gradle and Maven examples below.\n\n### Gradle\nAdd the following to your build.gradle file:\n\n```\nrepositories {\n    mavenCentral()\n    maven { url \"https://jitpack.io\" }\n}\n\ndependencies {\n    implementation 'com.github.thewaterfall:fluent-request:1.3.1'\n}\n```\n\n### Maven\nAdd the following to your pom.xml file:\n\n```\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.github.thewaterfall\u003c/groupId\u003e\n        \u003cartifactId\u003efluent-request\u003c/artifactId\u003e\n        \u003cversion\u003e1.3.1\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n## Usage\n\nThe `FluentRequest` class is the core of the library, providing a fluent interface for constructing and sending HTTP requests. It supports various HTTP methods, request body types, headers, and authentication methods. Additionally, it allows customization of the OkHttp client and Jackson ObjectMapper.\n\n### Example 1: Fetching an entity\n\nLet's assume you want to fetch a single article by its ID. The endpoint for this example is `https://example.com/articles/1`.\n\n```\nFluentRequest.request(\"https://example.com/articles/1\", Article.class)\n    .get();\n```\n\n### Example 2: Creating an entity\nSuppose you want to create a new article by sending a POST request with the article data. Let's assume the endpoint is https://example.com/articles.\n\n```\nArticle newArticle = new Article(\"New Article Title\", \"Content goes here\");\n\nFluentRequest.request(\"https://example.com/articles\", Article.class)\n    .bearer(\"YOUR_ACCESS_TOKEN\") // Assuming you need authentication\n    .body(newArticle)\n    .post();\n```\n\n### Example 3: Updating an entity\nLet's say you want to update an existing article with ID 1. The endpoint for this example is https://example.com/articles/1.\n\n```\nArticle updatedArticle = new Article(\"Updated Title\", \"Updated content\");\n\nFluentRequest.request(\"https://example.com/articles/1\", Article.class)\n    .bearer(\"YOUR_ACCESS_TOKEN\")\n    .body(updatedArticle)\n    .patch();\n```\n\n### Example 4: Uploading a file\n\n```\nFile file = new File(\"path/to/file.txt\");\n\nFluentRequest.request(\"https://example.com/upload\", String.class)\n    .multipart()\n        .add(\"username\", \"john_doe\")  // Additional form field\n        .add(\"fileKey\", \"filename.txt\", fileToUpload)  // File to upload\n    .build()\n    .post();\n```\n\n### Example 5: Using variables and parameters\nThe below example will result in building the following URL https://example.com/articles/1/comments?sort=asc.\n\n```\nFluentRequest.request(\"https://example.com/articles/{articleId}/comments\", Comment[].class)\n    .variable(\"articleId\", 1)\n    .parameter(\"sort\", \"asc\")\n    .get();\n```\n\n### Example 6: Using generic type as a response body type\n\n```\nFluentRequest.request(\"https://example.com/articles\", new TypeReference\u003cList\u003cArticle\u003e\u003e() {})\n    .get();\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthewaterfall%2Ffluent-request","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthewaterfall%2Ffluent-request","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthewaterfall%2Ffluent-request/lists"}