Explorar el Código

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

lvshuang hace 8 años
padre
commit
66449ccb2f
Se han modificado 1 ficheros con 3 adiciones y 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;