浏览代码

* Fix missing Content-Type header

git-svn-id: trunk@30859 -
michael 10 年之前
父节点
当前提交
f512f71566
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      packages/googleapi/src/googleservice.pp

+ 2 - 0
packages/googleapi/src/googleservice.pp

@@ -520,6 +520,8 @@ begin
   Resp:=Nil;
   try
     Req:=googleclient.WebClient.CreateRequest;
+    if (AInput<>'') then
+      Req.Headers.Values['Content-type']:='application/json';
     Req.SetContentFromString(AInput);
     If Not APINeedsAuth then
       Resp:=googleclient.WebClient.ExecuteRequest(AMethod,URL,Req)