Make it easier to send a Multipart.FormData request
- Dominant language
- Scala
- Stars
- 1.4k
- Forks
- 584
- Avg merge
- 14h 33m
- Merged PRs (30d)
- 24
Description
**Issue by [ktoso](https://github.com/ktoso)**
_Monday Feb 29, 2016 at 16:13 GMT_
_Originally opened as https://github.com/akka/akka/issues/19916_
---
@sirthias @jrudolph did I miss some API or that's the current way to put it?
``` scala
val formData = Multipart.FormData(BodyPart("lol", HttpEntity(MediaTypes.`application/pdf`, new File("example.txt"))))
val requestEntity = Await.result(Marshal(formData).to[RequestEntity], 1.second)
val req = HttpRequest(HttpMethods.POST, uri = "http://example.com", entity = requestEntity)
Http().singleRequest(req)
```
Contributor guide
Research direction
Start by reading the current Multipart.FormData, Marshal, RequestEntity, and HttpRequest usage shown in the issue, then inspect the surrounding HTTP client API. The issue provides no target API or named files, so determine the intended simpler construction and define completion criteria with maintainers before changing code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100