Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boolean Value in Multipart Form-data

How do I pass a Boolean value as an input parameter to the Multipart form-data http post C# in both Postman and C# coding?

MultipartFormDataContent form = new MultipartFormDataContent();
form.Add(new StringContent("true"), "Customized");

I cannot directly give the true/false as one input parameter. If i give the value inside the string content, its not accepting as a boolean value. Is there any way to give the input parameter as a boolean?

like image 304
Dhivya Avatar asked Aug 13 '26 20:08

Dhivya


1 Answers

Try:

form.Add(new StringContent(myBool.ToString()), "Customized");

or:

form.Add(new StringContent($"{myBool}"), "Customized");
like image 137
CokoBWare Avatar answered Aug 15 '26 10:08

CokoBWare



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!