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?
Try:
form.Add(new StringContent(myBool.ToString()), "Customized");
or:
form.Add(new StringContent($"{myBool}"), "Customized");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With