我使用afnetworing将图片上传到服务器,并且当我使用charles或burpsuit捕获上传的http包时,它总是可以的(返回200),但是当我使用手机4g或wifi而没有代理服务器时捕获工具,它将失败(返回400码)
我认为它存在一些SSL问题,但是我的其他未上传的https请求总是成功的。
我的捕获http
POST /api/v1/common/file/image HTTP/1.1
Host: test.community.zuanlikeji.com
Content-Type: multipart/form-data; boundary=Boundary+2D75FD945F344574
Connection: close
Accept: */*
User-Agent: zhinengshequ/1.0 (iPhone; iOS 12.1.4; Scale/2.00)
Accept-Language: zh-Hans-CN;q=1, en-CN;q=0.9
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjoxMDAwMDAwMDIsImV4cCI6MTU1NjI1NDI5N30.Dodi_xBp4zZXChM5GX1uJ_lCrjeJxJK0vRbFGh7Q
Content-Length: 758115
--Boundary+2D75FD945F344574
Content-Disposition: form-data; name="file"; filename="4462942064.jpg"
Content-Type: image/jpeg
....
我的错误
Error Domain=com.alamofire.error.serialization.response Code=400 "Request failed: bad request (400)" UserInfo={NSLocalizedDescription=Request failed: bad request (400), NSErrorFailingURLKey=https://test.community.zuanlikeji.com/api/v1/common/file/image, com.alamofire.serialization.response.error.data=<>, com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x283130be0> { URL: https://test.community.zuanlikeji.com/api/v1/common/file/image } { Status Code: 400
那为什么会发生呢?你能在以前的项目中得到它吗?我需要帮助!谢谢!