{"id":37028716,"url":"https://github.com/dzieciou/curl-logger","last_synced_at":"2026-01-14T03:26:22.432Z","repository":{"id":5337492,"uuid":"52904460","full_name":"dzieciou/curl-logger","owner":"dzieciou","description":"Logs HTTP requests sent by REST-assured as CURL commands.","archived":false,"fork":false,"pushed_at":"2024-06-03T21:29:15.000Z","size":354,"stargazers_count":69,"open_issues_count":15,"forks_count":23,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-08T22:40:31.726Z","etag":null,"topics":["http","rest","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dzieciou.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}},"created_at":"2016-03-01T19:39:06.000Z","updated_at":"2024-12-18T07:13:37.000Z","dependencies_parsed_at":"2024-03-12T20:06:54.207Z","dependency_job_id":null,"html_url":"https://github.com/dzieciou/curl-logger","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/dzieciou/curl-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzieciou%2Fcurl-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzieciou%2Fcurl-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzieciou%2Fcurl-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzieciou%2Fcurl-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dzieciou","download_url":"https://codeload.github.com/dzieciou/curl-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzieciou%2Fcurl-logger/sbom","scorecard":{"id":362743,"data":{"date":"2025-08-11","repo":{"name":"github.com/dzieciou/curl-logger","commit":"39b578213bcd2db1d9a78afc66e3c01dc2048541"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":3,"reason":"Found 2/6 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/badges.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/badges.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/badges.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/badges.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/badges.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/badges.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/format.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/format.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/format.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/format.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/dzieciou/curl-logger/test.yml/master?enable=pin","Info:   0 out of  13 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Warn: no topLevel permission defined: .github/workflows/badges.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/format.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T11:11:10.516Z","repository_id":5337492,"created_at":"2025-08-18T11:11:10.516Z","updated_at":"2025-08-18T11:11:10.516Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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","rest","testing-tools"],"created_at":"2026-01-14T03:26:21.775Z","updated_at":"2026-01-14T03:26:22.424Z","avatar_url":"https://github.com/dzieciou.png","language":"Java","funding_links":["https://www.buymeacoffee.com/dzieciou"],"categories":[],"sub_categories":[],"readme":"# CURL Logger\n\n[![Tests Status](https://github.com/dzieciou/curl-logger/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/dzieciou/curl-logger/actions/workflows/test.yml/badge.svg?branch=master)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.dzieciou.testing/curl-logger/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.dzieciou.testing/curl-logger)\n![Line coverage](.github/badges/jacoco.svg)\n![Branch coverage](.github/badges/branches.svg)\n\nLogs HTTP requests sent by [REST-assured][9] as [CURL][1] commands.\n\nThe following request from REST-assured test\n```java  \ngiven()\n  .config(config)\n  .redirects().follow(false)\n.when()\n  .get(\"http://google.com\")\n.then()\n  .statusCode(302); \n```\nwill be logged as:\n```bash\ncurl 'http://google.com/' -H 'Accept: */*' -H 'Content-Length: 0'  -H 'Connection: Keep-Alive' \n  -H 'User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_112)' -H 'Content-Type: multipart/mixed' \n  --compressed -k -v\n```\n\nThis way testers and developers can quickly reproduce an issue and isolate its root cause. \n\n## Usage\n\nLatest release:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.dzieciou.testing\u003c/groupId\u003e\n  \u003cartifactId\u003ecurl-logger\u003c/artifactId\u003e\n  \u003cversion\u003e3.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n   \n### Using with REST-assured client \n    \nWhen sending HTTP Request with REST-assured, you must create `RestAssuredConfig` instance first\n as follows:\n        \n```java\nRestAssuredConfig config = CurlRestAssuredConfigFactory.createConfig();  \n```\n  \nand then use it:\n\n```java\ngiven()\n  .config(config)\n  ...\n```\n\nIf you already have a `RestAssuredConfig` instance, you may reconfigure it as follows:\n\n```java\nRestAssuredConfig config = ...;\nconfig = CurlRestAssuredConfigFactory.updateConfig(config);  \n```\n\nNOTE: The library updates `httpClient` attribute of a `RestAssuredConfig` instance, so your changes to this attribute will be overwritten. Also, if you modify `htttpClient` attribute after calling `updateConfig()` or `createConfig()` method, curl-logger will no longer log requests.\n\nThe library provides a number of options for the way curl is generated and logged. They can be\ndefined with `Options` class. For instance:\n \n```java\nOptions options = Options.builder()...build();\nRestAssuredConfig config = CurlRestAssuredConfigFactory.createConfig(options);  \n```\n\nThere is a separate section listing all options.\n \n### Configuring logger \n\nCURL commands are logged to a \"curl\" logger. The library requires only the logger to be [slf4j][4]-compliant, e.g.,\nusing [logback][5]. Sample logback configuration that logs all CURL commands to standard system output would be:\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cconfiguration\u003e\n    \u003cappender name=\"STDOUT\" class=\"ch.qos.logback.core.ConsoleAppender\"\u003e\n        \u003cencoder\u003e\n            \u003cpattern\u003e%-4relative [%thread] %-5level %logger{35} - %msg %n\u003c/pattern\u003e\n        \u003c/encoder\u003e\n    \u003c/appender\u003e\n    \u003clogger name=\"curl\" level=\"DEBUG\"\u003e\n        \u003cappender-ref ref=\"STDOUT\"/\u003e\n    \u003c/logger\u003e\n\u003c/configuration\u003e\n```\n\n\n## Options\n\n### Printing stacktrace\n\nThe library provides a way to log stacktrace where the curl was generated:\n```java  \nOptions.builder().logStacktrace().build();\n```\nThis might be particularly useful when your test is sending multiple requests and you cannot find\nwhich request generated  printed curl command.\n\nBy default `CurlRestAssuredConfigFactory#createConfig` creates configuration that prints a curl command without stacktrace.\n\n### Configure log level\n\nThere is a way to define at which log level the log statement should be created:\n```java  \nOptions.builder().useLogLevel(Level.INFO).build();\n```\n\nBy default the curl commands are generated at `DEBUG` level, but depending on the context it might \nbe handy to log at a higher level.\n\n\n### Generating curl for Windows vs Unix \n\nThe curl command generated by the library is platform-specific.\n\nFor instance, curl command generated for Unix platform\n\n```bash\ncurl 'http://testapi.com/post' --data-binary $'{\\r\\n   \\'name\\':\\'Administra\\xe7\\xe3o\\',\\r\\n   \n  \\'email\\':\\'admin@gmail.com\\',\\r\\n   \\'password\\':\\'abc%\"\\'\\r\\n}'\n```\n\nwill look different when generated for Windows platform:\n\n```cmd\ncurl \"http://testapi.com/post\" --data-binary \"{\"^\n\n\"   'name':'Administração',\"^\n\n\"   'email':'admin@gmail.com',\"^\n\n\"   'password':'abc\"%\"\"\"'\"^\n\n\"}\"\n```\n\nThe difference is in:\n- how strings are quoted,\n- how different characters (non-ASCII characters,\nnon-printable ASCII characters and characters with special meaning) are escaped,\n- and how new lines in multiline command are printed.\n\nBy default, the library assumes the target platform on which curl command will be executed is the \nsame as the platform where it was generated. However, when you work on two different platforms, \nsometimes a curl command generated on Unix might not be portable to Windows, and vice-versa.  \n\nIn such situations, the library provides a way to force target platform, e.g.,:\n```java\nOptions.builder().targetPlatform(Platform.UNIX).build();\n```\n\nEven if origin and target platform are the same, some characters must be escaped, because \nthe generated curl command will be copy-pasted on a multitude of setups by a wide range of people. \nI don't want the result to vary based on people's local encoding or misconfigured terminals. The \ndownside of this might be less legible commands like `Administra\\xe7\\xe3o` instead of \n`Administração`. If you want your commands to be more legible (and bound to specific terminal setups)\nyou may disable escaping non-ASCII characters by using the following option (for Unix only):\n```java\nOptions.builder().dontEscapeNonAscii().build();\n```\n\n### Printing curl in multiple lines\n\nThe library enables printing a curl command in multiple lines:\n```java\nOptions.builder().printMultiliner().build();\n```\n\nOn Unix systems it will look like this:\n```bash\ncurl 'http://google.pl/' \\ \n  -H 'Content-Type: application/x-www-form-urlencoded' \\ \n  --data-binary 'param1=param1_value\u0026param2=param2_value' \\ \n  --compressed \\ \n  -k \\ \n  -v\n```\nand on Windows:\n```cmd\ncurl 'http://google.pl/' ^ \n  -H 'Content-Type: application/x-www-form-urlencoded' ^ \n  --data-binary 'param1=param1_value\u0026param2=param2_value' ^ \n  --compressed ^ \n  -k ^ \n  -v\n```\n\n### Logging request body\n\nNote, for either platform, the body of a request is always logged as `--binary-data` instead of \n`--data` because the latter  strips newline (`\\n`) and carriage return (`\\r`) characters. \n\n### Printing curl parameters in long form\n\nThe library enables printing longer form of curl parameters, e.g. `--header` instead of `-H`:\n```java\nOptions.builder().useLongForm().build();\n```\n\nHere's an example of a curl command generated with parameters in default short form (note, not \nall parameters have corresponding short form):\n\n```bash\ncurl 'http://google.pl/' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Host: google.pl' \n  -H 'User-Agent: 'User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_112)' \n  -H 'Connection: Keep-Alive' --data-binary 'param1=param1_value\u0026param2=param2_value' --compressed -k -v\n```\n\nAfter enabling long form option it would look as follows:\n\n```bash\ncurl 'http://google.pl/' -header 'Content-Type: application/x-www-form-urlencoded' \n  --header 'Host: google.pl'  --header 'User-Agent: 'User-Agent: Apache-HttpClient/4.5.2 \n     (Java/1.8.0_112)' --header 'Connection: Keep-Alive' \n  --data-binary 'param1=param1_value\u0026param2=param2_value' --compressed --insecure --verbose\n```\n\nBy default `CurlRestAssuredConfigFactory#createConfig` create configuration  that prints\n a curl command parameters in short form.\n\n### Printing request methods\n\nBy default, curl-logger does not print HTTP method for GET requests and POST requests without data. To always print \nrequest method, method configure curl-logger as follows:\n\n```java\nOptions.builder().alwaysPrintMethod().build();\n```\n\n### Updating curl command before print\n\nThe library provides a way to modify curl command before \nprinting:\n```java\nOptions.builder().updateCurl(curl -\u003e ...).build();\n```\n\n`#updateCurl` method takes instance of `Consumer\u003cCurlCommand\u003e` class. `CurlCommand` is a mutable \nrepresentation of curl and offers a number of methods to modify it: `#addHeader`, `#removeHeader`, etc.\n\nThis is useful to:\n* modify generated curl to test different variations of the same case\n* remove certain headers or parameters to make curl command more consise and thus easier to read\n\nFor instance, if you would like skip common headers like \"Host\", \"User-Agent\" and \"Connection\" \nfrom the following curl command:\n```bash\ncurl 'http://google.pl/' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Host: google.pl'  \n  -H 'User-Agent: 'User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_112)' \n  -H 'Connection: Keep-Alive'  --data-binary 'param1=param1_value\u0026param2=param2_value' --compressed -k -v\n```\n\nyou should define `Options` as follows:\n```java\nOptions.builder()\n  .updateCurl(curl -\u003e curl\n    .removeHeader(\"Host\")\n    .removeHeader(\"User-Agent\")\n    .removeHeader(\"Connection\"))\n  .build();\n```\n\nAs a result it will generate the following curl:\n```\ncurl 'http://google.pl/' -H 'Content-Type: application/x-www-form-urlencoded' \n  --data-binary 'param1=param1_value\u0026param2=param2_value' --compressed -k -v\n```\n\n### Custom curl handling\n\nBy default generated curls are logged. However, there's a way to process curl by one or more custom\nhandlers by providing a list of custom handlers, implementing `CurlHandler` interface. For instance, \nto store generated curls in a variable one could write:\n\n```java\nfinal List\u003cString\u003e curls = new ArrayList\u003c\u003e();\nCurlHandler handler = new CurlHandler() {\n  @Override\n  public void handle(String curl, Options options) {\n    curls.add(curl);\n  }\n};\nList\u003cCurlHandler\u003e handlers = Arrays.asList(handler);\nCurlRestAssuredConfigFactory.createConfig(handlers)\n```\n\n\n## Other features\n\n### Logging attached files\n\nWhen you attach a file to your requests via `multiPart`, e.g., sending content of \"README.md\" file\n\n```java\ngiven()\n  .config(CurlRestAssuredConfigFactory.createConfig())\n  .baseUri(\"http://someHost.com\")\n  .multiPart(\"myfile\", new File(\"README.md\"), \"application/json\")\n.when()\n  .post(\"/uploadFile\");\n```\n\nthe library will automatically include reference to it instead of pasting its content:\n```\ncurl 'http://somehost.com/uploadFile' -F 'myfile=@README.md;type=application/json' -X POST ...\n```\n\nNote, this won't work when uploading File not via `multipart`. Instead, content of the file will be\nprinted.\n\n```java\ngiven()\n  .config(CurlRestAssuredConfigFactory.createConfig())\n  .baseUri(\"http://someHost.com\")\n  .body(new File(\"README.md\"))\n.when()\n  .post(\"/uploadFile\");\n```\n\n## Prerequisities\n\n* JDK 11 or higher\n* Dependencies with which I tested the solution\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.apache.httpcomponents\u003c/groupId\u003e\n    \u003cartifactId\u003ehttpclient\u003c/artifactId\u003e\n    \u003cversion\u003e4.5.13\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.restassured\u003c/groupId\u003e\n    \u003cartifactId\u003erest-assured\u003c/artifactId\u003e\n    \u003cversion\u003e5.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Releases\n\n2.1.2:\n* Upgrade runtime dependencies: REST-assured from 4.4.0 to 5.2.0\n* Escape \"at\" character (@) only when it is first character in request (#80)\n\n2.1.1:\n* Upgrade runtime dependencies: REST-assured from 4.3.12 to 4.4.0, httpclient from 4.5.3 to 4.5.13, Guava from 28.0-jre to 29.0-jre\n* Upgrade development dependencies (to TestNG 7.4.0, mockito from 2.0.2-beta to 3.12.1)\n* Fixed bug [#74](https://github.com/dzieciou/curl-logger/issues/56): `Options.builder().updateCurl(curl -\u003e curl.removeHeader(\"Cookie\").build();` now correctly removes also Cookie header (thanks to @iamrulloh for reporting the problem)\n\n2.1.0:\n* Support for `alwaysPrintMethod` option that enables always printing HTTP method of a request (many thanks to Luigi \n  Cardito for his pull request)\n\n2.0.1:\n* Bug fix: Do not reuse HTTP client instance across multiple/parallel requests (fix for [#37](https://github.com/dzieciou/curl-logger/issues/37))\n* Bug fix: Make CurlHandler interface public (fix for [#56](https://github.com/dzieciou/curl-logger/issues/56))\n\n2.0.0:\n* Fix to invalid escaping of characters longer than 8 bits ([#47](https://github.com/dzieciou/curl-logger/issues/47), \n  thanks to Srepfler Srdan for reporting it)\n* Tested with latest REST-assured (4.3.1)\n* Support for custom log levels (thanks to Jérémie Bresson for pull request)\n* Support for custom curl handlers \n* Backward-incompatible change: `CurlLoggingRestAssuredConfigFactory` renamed to \n`CurlRestAssuredConfigFactory`. \n\n1.0.5:\n* Upgrade to REST-assured 4.0.0.\n* Update test scope dependencies.\n* Bug fix: fix character escaping for both POSIX and Windows platforms (many thanks to Chirag008 for raising\nthe issue: [#25](https://github.com/dzieciou/curl-logger/issues/25))\n\n1.0.4:\n* Bug fix: HTTPS protocol was not always recognized correctly \n([#17](https://github.com/dzieciou/curl-logger/issues/17)). Many thanks to pafitchett-ks for troubleshooting.\n* Support slf4j 1.8.0-beta2.\n* Support rest-assured 3.2.0. \n\n1.0.3:\n* Bug fix: Invalid basic authentication headers are failing curl generation \n([#15](https://github.com/dzieciou/curl-logger/issues/15))\n\n1.0.2:\n* Bug fix: CurlLogger was failing when multiple Cookie headers are present in HTTP Request. Now it\n  only prints warning ([#37](https://github.com/dzieciou/curl-logger/issues/13))\n\n1.0.1:\n* Bug fix: `CurlLoggingRestAssuredConfigBuilder` was not updating `RestAssuredConfig` properly \n([#4](https://github.com/dzieciou/curl-logger/issues/4)): \n\n1.0.0:\n\n* First major release with stable public API\n* Provided a way to force target platform of generated curl command\n* Backward-incompatible change: `CurlLoggingRestAssuredConfigBuilder` replaced with \n`CurlRestAssuredConfigFactory` that uses `Options` class to configure curl generation process.\n\n0.7:\n\n* Added possibility to print shorter versions of curl parameters, e.g., -v instead of --verbose\n* Added possibility to modify a curl command before printing it, inspired by the suggestion from \n  Alexey Dushen (blacky0x0): [#2](https://github.com/dzieciou/curl-logger/issues/2).\n\n0.6:\n* Fixed bug: For each cookie a separate `-b cookie=content` parameter was generated \n  ([#6](https://github.com/dzieciou/curl-logger/issues/4))\n* Upgraded to REST-assured 3.0.2\n* Simplified curl-logger configuration with `CurlLoggingRestAssuredConfigBuilder`, based on suggestion from Tao Zhang \n([#4](https://github.com/dzieciou/curl-logger/issues/4))\n\n0.5:\n\n* Upgraded to REST-assured 3.0.1 that contains important fix impacting curl-logger: Cookie attributes are no longer sent\n  in request in accordance with RFC6265. \n* Fixed bug: cookie values can have = sign inside so we need to get around them somehow\n* Cookie strings are now escaped\n* `CurlLoggingInterceptor`'s constructor is now protected to make extending it possible \n* `CurlLoggingInterceptor` can now be configured to print a curl command in multiple lines\n \n\n0.4:\n \n* Upgraded to REST-assured 3.0\n\n0.3:\n\n * Each cookie is now defined with `-b` option instead of `-H`\n * Removed heavy dependencies like Guava\n * Libraries like REST-assured and Apache must be now provided by the user (didn't want to constrain users to a specific version)\n * Can log stacktrace where curl generation was requested\n\n0.2:\n\n * Support for multipart/mixed and multipart/form content types\n * Now all generated curl commands are `--insecure --verbose`\n \n0.1:\n\n * Support for logging basic operations\n\n\n\n## Similar tools\n  \n* Chrome Web browser team has [\"Copy as CURL\"][7] in the network panel, similarly [Firebug add-on][8] for Firefox.\n* OkHttp client provides similar request [interceptor][3] to log HTTP requests as curl command. \n* [Postman add-on][6] for Chrome provides a way to convert prepared requests as curl commands.\n\n\n  [1]: https://curl.haxx.se/\n  [2]: https://github.com/dzieciou/curl-logger/issues\n  [3]: https://github.com/mrmike/Ok2Curl \n  [4]: http://www.slf4j.org/\n  [5]: http://logback.qos.ch/\n  [6]: https://www.getpostman.com/docs/creating_curl\n  [7]: https://coderwall.com/p/-fdgoq/chrome-developer-tools-adds-copy-as-curl\n  [8]: http://www.softwareishard.com/blog/planet-mozilla/firebug-tip-resend-http-request/\n  [9]: http://rest-assured.io/\n\n## Bugs and features request\n\nReport or request in [Issues][2].\n\n## Contribute!\n\nThis is an open-source library, and contributions are welcome. You're welcome to fork this project \nand send me a pull request.\n\n## Supporting \n\nThis is an open-source library that I give for free to the community as my way of saying thank you\nfor all the support I have received from this community.\n\nIf you like my work and want to say thank you as well then:\n\n[![Buy me a coffee](https://cdn.buymeacoffee.com/buttons/default-blue.png)](https://www.buymeacoffee.com/dzieciou)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdzieciou%2Fcurl-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdzieciou%2Fcurl-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdzieciou%2Fcurl-logger/lists"}