考虑.Net服务中的以下代码
public async Task<Stream> GetBlob(string url) {
WebClient client = new WebClient();
Stream download = await client.OpenReadTaskAsync(url);
_operationContext.OperationCompleted += delegate
{
download.Close();
download.Dispose();
};
return download;
}
这有效,我得到了二进制数据但没有正确的内容类型(我得到application / octet-stream,因为它应该是image / jpeg)。如何传递/获取正确的mimetype?