Last active
December 18, 2015 02:48
-
-
Save AbhishekGhosh/5713705 to your computer and use it in GitHub Desktop.
API example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RestRequest | |
{ | |
protected $url; | |
protected $verb; | |
protected $requestBody; | |
protected $requestLength; | |
protected $username; | |
protected $password; | |
protected $acceptType; | |
protected $responseBody; | |
protected $responseInfo; | |
public function __construct ($url = null, $verb = 'GET', $requestBody = null) | |
{ | |
$this->url = $url; | |
$this->verb = $verb; | |
$this->requestBody = $requestBody; | |
$this->requestLength = 0; | |
$this->username = null; | |
$this->password = null; | |
$this->acceptType = 'application/json'; | |
$this->responseBody = null; | |
$this->responseInfo = null; | |
if ($this->requestBody !== null) | |
{ | |
$this->buildPostBody(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment