Browse Source

Merge pull request #70 from 760e7dab2836853c63805033e/master

Add content-type response header support
Jan Oris 7 năm trước cách đây
mục cha
commit
a8c1fc2626
2 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 1 0
      README.md
  2. 1 0
      src/Builder.php

+ 1 - 0
README.md

@@ -375,6 +375,7 @@ The response object will look like this:
 {
    "content": "Message content here",
    "status": 200,
+   "contentType": "content-type response header (ex: application/json)",
    "error": "Error message goes here (Only added if an error occurs)"
 }
 ```

+ 1 - 0
src/Builder.php

@@ -489,6 +489,7 @@ class Builder {
         $object = new stdClass();
         $object->content = $content;
         $object->status = $responseData[ 'http_code' ];
+        $object->contentType = $responseData[ 'content_type' ];
         if( array_key_exists('errorMessage', $responseData) ) {
             $object->error = $responseData[ 'errorMessage' ];
         }