编辑2:我发现有些回复提到修改'数据类型',是一个标题?我确实尝试将Content-Type
修改为application/json
但没有帮助。
Host: localhost:26479 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Referer: http://localhost:26479/Home/FileUploadBrowser Content-Type: multipart/form-data; boundary=---------------------------41184676334 Content-Length: 1104
我有以下控制器方法(仍在进行中):
Function uploadFileToAmazon(ByVal key As String) As ActionResult
Dim incomingStream As Stream = Me.Request.InputStream
Dim bucketName As String = ""
Dim accessKey As String = ""
Dim secretKey As String = ""
ConnectToAmazon(bucketName, accessKey, secretKey)
Dim client As AmazonS3 = Amazon.AWSClientFactory.CreateAmazonS3Client(accessKey, secretKey, RegionEndpoint.USEast1)
Dim titledRequest As PutObjectRequest
titledRequest = New PutObjectRequest
With titledRequest
.WithBucketName(bucketName)
.WithKey(key)
.WithInputStream(incomingStream)
End With
Dim response As S3Response = client.PutObject(titledRequest)
Return Json(New With {Key .success = "true", Key .msg = "uploaded"})
End Function
原始问题:
这是我遇到的问题,由于某种原因,它在完成<pre>{"success":"true","msg":"uploaded"}</pre>
后向前端发送以下消息。我很困惑,这个<pre>
标签来自哪里以及如何摆脱它?谢谢