idhttp post 中文,服务器端收到是问号。
IDHTTP设置如下:
with IdHTTP1 do
begin
ProtocolVersion := pv1_1;
Request.ContentType := 'application/json';
Request.UserAgent := 'Mozilla/3.0 (compatible; Indy Library)';
Request.AcceptEncoding := 'gzip, deflate';
Request.Accept := '*/*';
Request.CacheControl := 'no-cache';
Request.BasicAuthentication := False;
Request.CharSet := 'utf-8';
Request.ContentEncoding := 'utf-8';
end;
服务器端编码格式是UTF-8,客户端的IDHTTP,POST过去,服务器收到的中文是???问号的形式。