求助,iOS使用google PB

Secret 发布于 2015年03月09日
无人欣赏。

新手求问,在iOS中使用google PB的时候为什么我发送的数据字节长度为90bytes而server返回的数据显示我发送的数据却是166,在线等

共3条回复
tinyfool 回复于 2015年03月09日

包的尺寸?

Secret 回复于 2015年03月09日

站长你好,在发送之前处理的时候是这样的,int kValue = (int)(99999989 + data.length(发送的PB数据体的长度90bytes) + 2(添加到PB数据前面的标识))/3 ; kValue是拼接到URL字符串的,而服务器返回的response是: Connection = close; "Content-Length" = 166; "Content-Type" = "text/html; charset=utf-8"; Date = "Mon, 09 Mar 2015 03:20:33 GMT"; Server = openresty;

Secret 回复于 2015年03月09日

补充下,在请求的时候[theRequest setValue:@"application/x-protobuf" forHTTPHeaderField:@"Content-Type"];已经设置了Content-Type,但是server的返回结果还是"Content-Type" = "text/html; charset=utf-8";一同求问,谢谢了

登录 或者 注册
相关帖子