Explorar o código

Add content type 'application/json' support in post request

lvshuang %!s(int64=8) %!d(string=hai) anos
pai
achega
66449ccb2f
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      Protocols/Http.php

+ 3 - 0
Protocols/Http.php

@@ -168,6 +168,9 @@ class Http
                     case 'multipart/form-data':
                         self::parseUploadFiles($http_body, $http_post_boundary);
                         break;
+                    case 'application/json':
+                        $_POST = json_decode($http_body, true);
+                        break;
                     case 'application/x-www-form-urlencoded':
                         parse_str($http_body, $_POST);
                         break;