dart-lang / dart-lang/http

To handle multi-VALUE fields in a POST request

Open
#534 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
1.1k
Forks
419
Avg merge
4d 14h
Merged PRs (30d)
8

Description

I have this request working on a Linux terminal:

`curl -X POST "https://my-api.plantnet.org/v2/identify/all?api-key=11111111111111111111" -H "accept: application/json" -F "organs=flower" -F "organs=leaf" -F "images=@images/image_1.jpeg" -F "images=@images/image_2.jpeg"
`

As you may have seen there are two **multi-value fields**, _organs_ and _images_, one is for _String_ objects and the another is for _File_ objects.

I'm trying to recreate this command by using **http** package with Dart. I've used **post** and **MultipartRequest** methods but these methods does apparently not support fields with multiple values like the request showed above. I've googled and posted questions in forums, NO ANSWERS. So I must suppose this feature is not implemented for this package, therefore I request you can implement it please.

PS: in other languages like Javascript is possible to send fields with multi-values.

Contributor guide

Open the contributing guide

Research direction

The issue names the Dart http package's post and MultipartRequest APIs; start by inspecting how those APIs represent repeated organs and images fields, then reproduce the curl example. Done means a multipart POST can send repeated string and file values in the same request.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.