We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 865e61e commit d5a4720Copy full SHA for d5a4720
App/Models/Http.php
@@ -139,6 +139,22 @@ public function getStatus()
139
return curl_getinfo($this->ch, CURLINFO_HTTP_CODE);
140
}
141
142
+ /**
143
+ * getBody - returns the response body
144
+ *
145
+ * @return string - the response body
146
+ */
147
+ public function getBody()
148
+ {
149
+ curl_setopt($this->ch, CURLOPT_HEADER, 0);
150
+ curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
151
+ $response = curl_exec($this->ch);
152
+ if ($response === false) {
153
+ throw new \Exception(curl_error($this->ch), curl_errno($this->ch));
154
+ }
155
+ return $response;
156
157
+
158
/**
159
* Encoding - sets the encoding(s) for the request
160
*
0 commit comments