如果您在响应中有一些正文,那么您可以尝试这样的事情:
var request = new BackgroundTransferRequest(targetUri)
{
DownloadLocation = new Uri(downloadTo, UriKind.Relative),
UploadLocation = new Uri(uploadFrom, UriKind.Relative),
Method = "POST"
};
在这里,您的响应将被写入在 DownloadLocation 路径中创建的文件中。
另外,在 WP8.1 中,我认为他们直接支持在后台上传器中访问响应。你可以试试看:
ResponseInformation response = upload.GetResponseInformation();
foreach (KeyValuePair<string, string> kvp in response.Headers)
{
Debug.WriteLine("Header: {0}, Value: {1}", kvp.Key, kvp.Value);
}
上传在哪里:
BackgroundUploader uploader = new BackgroundUploader();
UploadOperation upload = await uploader.CreateUploadAsync(uri, parts);