You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I pass "application/base64" as the mediaType, I got the following error message.
new StringContent(fileContent, Encoding.UTF8,"application/base64")
The best overloaded method match for 'System.Net.Http.StringContent.StringContent(string, System.Text.Encoding, string)' has some invalid arguments
ExceptionType:Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
Assembly:Anonymously Hosted DynamicMethods Assembly
Method:System.Net.Http.StringContent CallSite.Target(System.Runtime.CompilerServices.Closure, System.Runtime.CompilerServices.CallSite, System.Type, System.Object, System.Text.Encoding, System.String)
I find the media type from this page.
I am not sure if this class can support all media types.
I wonder if you guys can list how many media types are supported for StringContent's constructor.
The text was updated successfully, but these errors were encountered:
The error message talks about overload resolution, which means you're using dynamic and types of parameters you passed in couldn't be matched to any overload of the StringContent constructor.
I'm pretty sure this is because fileContent is not a string, which it has to be according to the method signature. This has nothing to do with the mediaType you used.
StringContent(String, Encoding, String)
The third parameter is mediaType String
The media type to use for the content.
When I pass "application/base64" as the mediaType, I got the following error message.
I find the media type from this page.
I am not sure if this class can support all media types.
I wonder if you guys can list how many media types are supported for StringContent's constructor.
The text was updated successfully, but these errors were encountered: