{"id":16379060,"url":"https://github.com/derklaro/requestbuilder","last_synced_at":"2026-01-21T15:33:13.654Z","repository":{"id":39641356,"uuid":"234922987","full_name":"derklaro/requestbuilder","owner":"derklaro","description":"A request builder for web applications completely based on java","archived":false,"fork":false,"pushed_at":"2023-12-15T08:37:10.000Z","size":101,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-08T04:48:38.331Z","etag":null,"topics":["builder","requests","web"],"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/derklaro.png","metadata":{"files":{"readme":".github/README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-19T15:40:05.000Z","updated_at":"2024-06-16T16:51:36.000Z","dependencies_parsed_at":"2024-10-28T15:23:59.302Z","dependency_job_id":"94813477-47f5-41cc-ba35-c7e40ddbc35a","html_url":"https://github.com/derklaro/requestbuilder","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/derklaro/requestbuilder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derklaro%2Frequestbuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derklaro%2Frequestbuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derklaro%2Frequestbuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derklaro%2Frequestbuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derklaro","download_url":"https://codeload.github.com/derklaro/requestbuilder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derklaro%2Frequestbuilder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28635895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T15:01:31.228Z","status":"ssl_error","status_checked_at":"2026-01-21T14:42:58.942Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["builder","requests","web"],"created_at":"2024-10-11T03:47:22.061Z","updated_at":"2026-01-21T15:33:13.636Z","avatar_url":"https://github.com/derklaro.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RequestBuilder [![Discord](https://img.shields.io/discord/499666347337449472.svg?color=7289DA\u0026label=discord)](https://discord.gg/uskXdVZ) [![](https://jitpack.io/v/derklaro/requestbuilder.svg)](https://jitpack.io/#derklaro/requestbuilder)\n\nThis repository provides a simple request builder for url connections completely based on the java provided classes\nwithout any external dependencies (main goal).\n\n## Support our work\n\nIf you like the request builder and want to support our work you can **star** :star2: and join\nour [Discord](https://discord.gg/uskXdVZ).\n\n## Found a bug or have a proposal?\n\nPlease\n[**open an issue**](https://github.com/derklaro/reformcloud2-prefix-system/issues/new)\nand ***describe the bug/proposal as detailed as possible*** and **look into your email if we have replied to your issue\nand answer upcoming questions**.\n\n## Dependencies\n\nTo include the project in yours you may use the following dependencies:\n\nMaven repository:\n\n```xml\n\u003crepository\u003e\n    \u003cid\u003ejitpack.io\u003c/id\u003e\n    \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n\u003c/repository\u003e\n```\n\nMaven dependency:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.derklaro\u003c/groupId\u003e\n    \u003cartifactId\u003erequestbuilder\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.6\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nGradle repository:\n\n```groovy\nmaven {\n    name 'jitpack.io'\n    url 'https://jitpack.io'\n}\n```\n\nGradle dependency:\n\n```groovy\ncompile group: 'com.github.derklaro', name: 'requestbuilder', version: '1.0.5'\n```\n\n## The builder class\n\n```java\npublic class Main {\n\n  public static void main(String[] args) {\n    // Creates a simple builder with 'https://google.de' as target and no proxy\n    RequestBuilder requestBuilder = RequestBuilder.newBuilder(\"https:google.de\", Proxy.NO_PROXY);\n\n    // We are now only accepting 'application/json' as result mime type\n    requestBuilder.accepts(MimeTypes.getMimeType(\"json\"));\n\n    // We are sending the mime type 'application/json'\n    requestBuilder.setMimeType(MimeTypes.getMimeType(\"json\"));\n\n    // We are following the redirects the server will make\n    requestBuilder.enableRedirectFollow();\n\n    // We are now able to use the output stream of the connection\n    requestBuilder.enableOutput();\n\n    // We are allowing the user to interact with the connection\n    requestBuilder.enableUserInteraction();\n\n    // We will now bypass the caches of the jvm\n    requestBuilder.disableCaches();\n\n    // We will now not accepting any incoming data\n    requestBuilder.disableInput();\n\n    // After 5 seconds the connect should time out\n    requestBuilder.setConnectTimeout(5, TimeUnit.SECONDS);\n\n    // We will make a get request. Possibilities are get, post, head, options, put, delete, trace\n    requestBuilder.setRequestMethod(RequestMethod.GET);\n\n    // We are setting the maximum amount of time the client will read from the connection\n    requestBuilder.setReadTimeOut(5, TimeUnit.SECONDS);\n\n    // Sets the specified cookie during the request\n    requestBuilder.addCookies(new HttpCookie(\"AName\", \"AValue\"));\n\n    // Adds a header to the connection\n    requestBuilder.addHeader(\"AKey\", \"AValue\");\n\n    // Adds a body to the request\n    requestBuilder.addBody(\"AKey\", \"AValue\");\n\n    try (RequestResult requestResult = requestBuilder.fireAndForget()) {\n      // now we can handle the result of the connection\n    }\n\n    requestBuilder.fireAndForgetAsynchronously().thenAccept(result -\u003e {\n      // handle the result of the request\n    });\n  }\n}\n```\n\n## The request result\n\n```java\npublic class Main {\n    public static void main(String[] args) {\n        RequestResult requestResult = requestBuilder.fireAndForget();\n        \n        // The status of the connection as an integer\n        requestResult.getStatusCode();\n\n        // The status of the request as wrapped object\n        requestResult.getStatus();\n\n        // Returns the result as string if the status code is == 200 else it will end up throwing an exception\n        requestResult.getSuccessResultAsString();\n\n        // Returns the result as string if the status code is != 200 else it will end up throwing an exception\n        requestResult.getErrorResultAsString();\n\n        // Returns always a string and decides between error or normal input\n        requestResult.getResultAsString();\n\n        // Get all cookies the server has set\n        requestResult.getCookies();\n\n        // Get all cookies the server has set in the specified header field\n        requestResult.getCookies(\"MyHeader\");\n\n        // Get the output stream which is direction -\u003e to server\n        requestResult.getOutputStream();\n\n        // Get the target input stream (direction -\u003e to client)\n        // Error -\u003e returns the error stream (status != 200)\n        // Default -\u003e returns the default input stream (status == 200)\n        // Choose -\u003e chooses between error and default by result state\n        requestResult.getStream(StreamType.CHOOSE);\n\n        // If the connection to server has failed\n        requestResult.hasFailed();\n\n        // If the client is still connected to server\n        requestResult.isConnected();\n\n        // Closes the request and disconnects from the server\n        try {\n            requestResult.close();\n        } catch (Exception exception) {\n            exception.printStackTrace();\n        }\n    }\n}\n```\n\n## Build this project\n\n```\ngit clone https://github.com/derklaro/requestbuilder.git\ncd requestbuilder/\nmvn clean package\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderklaro%2Frequestbuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderklaro%2Frequestbuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderklaro%2Frequestbuilder/lists"}