Explorar o código

* Fix missing Content-Type header

git-svn-id: trunk@30859 -
michael %!s(int64=10) %!d(string=hai) anos
pai
achega
f512f71566
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      packages/googleapi/src/googleservice.pp

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

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