getContentTypeString static method
Returns the appropriate content type string for the given ContentType enum
Implementation
static String getContentTypeString(ContentType? contentType) {
switch (contentType) {
case ContentType.json:
return 'application/json';
case ContentType.urlEncoded:
return 'application/x-www-form-urlencoded';
case ContentType.formData:
return 'multipart/form-data';
case ContentType.plainText:
return 'text/plain';
default:
return 'application/x-www-form-urlencoded';
}
}