{"id":41865262,"url":"https://github.com/tomitribe/simple-http-client","last_synced_at":"2026-01-25T11:39:56.152Z","repository":{"id":57740993,"uuid":"392984305","full_name":"tomitribe/simple-http-client","owner":"tomitribe","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-05T14:15:07.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-11-07T02:00:48.931Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomitribe.png","metadata":{"files":{"readme":"README.adoc","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-08-05T09:33:17.000Z","updated_at":"2021-08-05T14:15:09.000Z","dependencies_parsed_at":"2022-09-06T23:30:54.804Z","dependency_job_id":null,"html_url":"https://github.com/tomitribe/simple-http-client","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tomitribe/simple-http-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomitribe%2Fsimple-http-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomitribe%2Fsimple-http-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomitribe%2Fsimple-http-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomitribe%2Fsimple-http-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomitribe","download_url":"https://codeload.github.com/tomitribe/simple-http-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomitribe%2Fsimple-http-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28752668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T10:25:12.305Z","status":"ssl_error","status_checked_at":"2026-01-25T10:25:11.933Z","response_time":113,"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":[],"created_at":"2026-01-25T11:39:55.377Z","updated_at":"2026-01-25T11:39:56.146Z","avatar_url":"https://github.com/tomitribe.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= simple-http-client\n\nThis is a simple utility that has been adapted from Apache Tomcat unit tests, to enable testing HTTP servers.\nIt is specifically quite useful for sending malformed requests to servers to see how they behave. Most HTTP\nclient libraries will not enable you to build malformed requests.\n\nNOTE: This client is intended for testing purposes only, and should not be considered suitable for production use.\n\n== Example usage\n\nThe tests included in the source code provide an example of usage:\n\n\n```\nSimpleHttpClient client = new SimpleHttpClient() {\n            public Exception doRequest() {\n                try {\n                    setHostname(webappUrl.getHost());\n                    setPort(webappUrl.getPort());\n\n                    // Open connection\n                    connect();\n\n                    String[] request = new String[1];\n                    request[0] =\n                            \"GET /service/test HTTP/1.1\" + CRLF +\n                            \"Host: \" + webappUrl.getHost() + \":\" + webappUrl.getPort() + CRLF +\n                            \"sec-ch-ua: \\\"Chromium\\\";v=\\\"91\\\", \\\" Not;A Brand\\\";v=\\\"99\\\"\" + CRLF +\n                            \"sec-ch-ua-mobile: ?0\" + CRLF +\n                            \"Upgrade-Insecure-Requests: 1\" + CRLF +\n                            \"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36\" + CRLF +\n                            \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\" + CRLF +\n                            \"Sec-Fetch-Site: none\" + CRLF +\n                            \"Sec-Fetch-Mode: navigate\" + CRLF +\n                            \"Sec-Fetch-User: ?1\" + CRLF +\n                            \"Sec-Fetch-Dest: document\" + CRLF +\n                            \"Accept-Encoding: gzip, deflate\" + CRLF +\n                            \"Accept-Language: en-GB,en-US;q=0.9,en;q=0.8\" + CRLF +\n                            \"Connection: close\" + CRLF +\n                            \"\" + CRLF +\n                            \"\";\n\n                    setRequest(request);\n                    processRequest(); // blocks until response has been read\n\n                    // Close the connection\n                    disconnect();\n                } catch (Exception e) {\n                    return e;\n                }\n                return null;\n            }\n\n            @Override\n            public boolean isResponseBodyOK() {\n                // TODO: add assertions here\n                return true;\n            }\n        };\n\n        final Exception e = client.doRequest();\n\n        if (e != null) {\n            throw e;\n        }\n\n        Assert.assertTrue(client.isResponse200());\n        Assert.assertTrue(client.isResponseBodyOK());\n```\n\nThe SimpleHttpClient class provides a self-contained abstract class for you to implement\nthe `doRequest()` and `isResponseBodyOK()` methods.\n\nThe `doRequest()` method would typically call `setRequest()` with the request to execute as a plain string, and `processRequest()` to actually execute the request.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomitribe%2Fsimple-http-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomitribe%2Fsimple-http-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomitribe%2Fsimple-http-client/lists"}