original_string: public function post($url, $data, $contentType = 'application/json')
      {
          $uri = $this->buildUrl($url);
  
          $request = $this->requestFactory->createRequest('POST', $uri);
          if (!is_null($contentType)) {
              $request = $request->withHeader('Content-Type', $contentType);
              $request = $request->withHeader('Accept', $contentType);
          }
          $request = $request->withBody(stream_for($data));
  
          $response = $this->request($request);
  
          return strval($response->getBody());
      }
code: public function post($url, $data, $contentType = 'application/json')
      {
          $uri = $this->buildUrl($url);
  
          $request = $this->requestFactory->createRequest('POST', $uri);
          if (!is_null($contentType)) {
              $request = $request->withHeader('Content-Type', $contentType);
              $request = $request->withHeader('Accept', $contentType);
          }
          $request = $request->withBody(stream_for($data));
  
          $response = $this->request($request);
  
          return strval($response->getBody());
      }
code_tokens: public function post ( $ url , $ data , $ contentType = 'application/json' ) { $ uri = $ this -> buildUrl ( $ url ) ; $ request = $ this -> requestFactory -> createRequest ( 'POST' , $ uri ) ; if ( ! is_null ( $ contentType ) ) { $ request = $ request -> withHeader ( 'Content-Type' , $ contentType ) ; $ request = $ request -> withHeader ( 'Accept' , $ contentType ) ; } $ request = $ request -> withBody ( stream_for ( $ data ) ) ; $ response = $ this -> request ( $ request ) ; return strval ( $ response -> getBody ( ) ) ; }
docstring: Make a POST request.
  
  @param string $url
  @param $data
  @param string $contentType
  
  @return string The response body
docstring_tokens: Make a POST request .