public function post($url, $body, array $headers = array()) {
    // If body is array
    if (is_array($body)) {
      // Convert to string
      $body = http_build_query($body);
    }
    // Do post and get response
    $response = $this->getClient()->post($url, $body, $headers);
    // If not response
    if ( ! $response instanceof Response) {
      // Throw error
      throw new InvalidType('HttpInterface post method must return an instance of \Borla\Chikka\Support\Http\Response');
    }
    // Return response
    return $response;
  }
public function post($url, $body, array $headers = array()) {
    // If body is array
    if (is_array($body)) {
      // Convert to string
      $body = http_build_query($body);
    }
    // Do post and get response
    $response = $this->getClient()->post($url, $body, $headers);
    // If not response
    if ( ! $response instanceof Response) {
      // Throw error
      throw new InvalidType('HttpInterface post method must return an instance of \Borla\Chikka\Support\Http\Response');
    }
    // Return response
    return $response;
  }
public function post ( $ url , $ body , array $ headers = array ( ) ) { // If body is array if ( is_array ( $ body ) ) { // Convert to string $ body = http_build_query ( $ body ) ; } // Do post and get response $ response = $ this -> getClient ( ) -> post ( $ url , $ body , $ headers ) ; // If not response if ( ! $ response instanceof Response ) { // Throw error throw new InvalidType ( 'HttpInterface post method must return an instance of \Borla\Chikka\Support\Http\Response' ) ; } // Return response return $ response ; }
Create post request
@return \Borla\Chikka\Support\Http\Response
Create post request