DirkGroenen\Pinterest\Transport\Request::post PHP Method

post() public method

Make a post request to the given endpoint
public post ( string $endpoint, array $parameters = [] ) : DirkGroenen\Pinterest\Transport\Response
$endpoint string
$parameters array
return DirkGroenen\Pinterest\Transport\Response
    public function post($endpoint, array $parameters = array())
    {
        return $this->execute("POST", sprintf("%s%s", $this->host, $endpoint), $parameters);
    }

Usage Example

 /**
  * Change the code for an access_token
  *
  * @param  string   $code
  * @return \DirkGroenen\Pinterest\Transport\Response
  */
 public function getOAuthToken($code)
 {
     // Build data array
     $data = array("grant_type" => "authorization_code", "client_id" => $this->client_id, "client_secret" => $this->client_secret, "code" => $code);
     // Perform post request
     $response = $this->request->post("oauth/token", $data);
     return $response;
 }