4

Content-Type: multipart/form-data;

In MultiPart/form data I have something like

"String header = '--'+boundary+'\nContent-Disposition: form-data; name="file"; filename="'+file.name+'";\nContent-Type: application/octet-stream';" --AaB03x

I need to add a boolean parameter non_svg = true How to pass it to a multipart/formData

Example :

Request   curl ‐F "firstName=Kris" \
                ‐F "publicKey=@idrsa.pub;type=text/plain" \
                echo.httpkit.com
Response     {
    "method": "POST",
    ...
    "headers": {
        "content‐length": "697",
        "content‐type": "multipart/form‐data;
        boundary = ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐488327019409 ",
        ...
    },
    "body": "‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐488327019409\r\n
    Content‐ Disposition: form‐ data;
    name = \"firstName\"\r\n\r\n
    Kris\ r\ n‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ 488327019409\ r\ n
    Content‐ Disposition: form‐ data;
    name = \"publicKey\";
    filename = \"id_rsa.pub\"\r\n
    Content‐ Type: text / plain\ r\ n\ r\ n‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ 488327019409‐‐\ r\ n ",
        ...
}


 ‐‐‐‐‐‐488327019409 ==>it is the boundry
Marmite Bomber
  • 19,886
  • 4
  • 26
  • 53

1 Answers1

2

You can't pass typed parameters using multipart/form-data. You can instead stringify your boolean parameters and pass non_svg="true".

gkhnavarro
  • 446
  • 2
  • 14