{"id":16122080,"url":"https://github.com/foxcapades/lib-k-multipart","last_synced_at":"2025-04-06T11:41:32.307Z","repository":{"id":65508492,"uuid":"561864266","full_name":"Foxcapades/lib-k-multipart","owner":"Foxcapades","description":"Kotlin MultiPart BodyPublisher for the JDK HttpClient API.","archived":false,"fork":false,"pushed_at":"2024-03-08T15:48:38.000Z","size":653,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-12T17:19:26.333Z","etag":null,"topics":["http","httpclient","jdk11","kotlin","multipart","multipart-formdata","multipart-uploads"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/Foxcapades.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-04T17:01:44.000Z","updated_at":"2022-11-04T19:41:57.000Z","dependencies_parsed_at":"2024-11-01T05:25:18.919Z","dependency_job_id":"886e0461-e81f-4055-9dbc-54c6941aa5ed","html_url":"https://github.com/Foxcapades/lib-k-multipart","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":0.1578947368421053,"last_synced_commit":"b9e84ed16b4e96f19bad34ba0659b70761eacf65"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Flib-k-multipart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Flib-k-multipart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Flib-k-multipart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Flib-k-multipart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Foxcapades","download_url":"https://codeload.github.com/Foxcapades/lib-k-multipart/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478234,"owners_count":20945262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","httpclient","jdk11","kotlin","multipart","multipart-formdata","multipart-uploads"],"created_at":"2024-10-09T21:09:19.643Z","updated_at":"2025-04-06T11:41:32.287Z","avatar_url":"https://github.com/Foxcapades.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"= K-MultiPart\n:source-highlighter: highlightjs\n:lib-version: 1.2.1\n\nimage:https://img.shields.io/github/license/foxcapades/lib-k-multipart[GitHub]\nimage:https://img.shields.io/badge/docs-dokka-violet[link=\"https://foxcapades.github.io/lib-k-multipart/dokka/1.2.0/\"]\nimage:https://img.shields.io/badge/jvm-11-purple[Java 11]\nimage:https://img.shields.io/maven-central/v/io.foxcapades.lib/k-multipart[Maven Central, link=\"https://search.maven.org/artifact/io.foxcapades.lib/k-multipart\"]\n\nKotlin `multipart/form-data` `BodyPublisher` implementation for the\nlink:https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpClient.html[Java `HttpClient` API].\n\n.build.gradle.kts\n[source, kotlin, subs=\"verbatim,attributes\"]\n----\n  implementation(\"io.foxcapades.lib:k-multipart:{lib-version}\")\n----\n\n== Usage\n\n[source,kotlin]\n----\nfun main(args: Array\u003cString\u003e) {\n  val client = HttpClient.newHttpClient()\n\n  val body = MultiPart.createBody {\n    withPart {\n      fieldName = \"foo\"\n      withBody(\"bar\")\n    }\n\n    withPart {\n      fieldName = \"fizz\"\n      withBody(File(\"buzz\"))\n    }\n  }\n\n  client.send(\n    HttpRequest.newBuilder(URI(args[0]))\n      .POST(body)\n      .build(),\n    HttpResponse.BodyHandlers.discarding()\n  )\n}\n----\n\n== Releases\n\n[%header, cols=\"1,1,6a\"]\n|===\n| Version | Docs | Notes\n\n| v1.2.1\n| link:https://foxcapades.github.io/lib-k-multipart/dokka/1.2.0/[Dokka]\n| * Corrects issue with encoding of wide unicode characters.\n* Adds optional charset indicator for overall request body.\n\n| v1.2.0\n| link:https://foxcapades.github.io/lib-k-multipart/dokka/1.2.0/[Dokka]\n| Adds new extension/mixin methods for the `HttpRequest.Builder` type allowing\ndirect publishing of `MultiPartBody` instances.\n\n| v1.1.0\n| link:https://foxcapades.github.io/lib-k-multipart/dokka/1.1.0/[Dokka]\n| Adds new methods to enable non-Kotlin JVM languages to use this library.\n\n| v1.0.1\n| link:https://foxcapades.github.io/lib-k-multipart/dokka/1.0.0/[Dokka]\n| Fixes content-type detection for file body parts.\n\n| v1.0.0\n| link:https://foxcapades.github.io/lib-k-multipart/dokka/1.0.0/[Dokka]\n| Initial release.\n|===","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxcapades%2Flib-k-multipart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxcapades%2Flib-k-multipart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxcapades%2Flib-k-multipart/lists"}