Skip to content

Commit

Permalink
Agreement Form Data Content Type
Browse files Browse the repository at this point in the history
* A request for the agreement form data requires a content type to be
set even if it doesn't match our request. This matches the behavior of
the swagger api docs.
  • Loading branch information
Nathan Horter committed Jan 9, 2017
1 parent 20f538d commit c0bcdfd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/Abstracts/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,14 @@ protected function simpleGetRequest( array $queryString = [ ], $userId = null, $
* @param array $query
* @return bool
*/
protected function saveFileRequest( $saveToPath, array $query = [ ] )
protected function saveFileRequest( $saveToPath, array $query = [ ], string $content_type = null )
{
$request = new GetRequest( $this->getOAuthToken(), $this->getRequestUrl( $query ) );
$request->setFileSavePath( $saveToPath );
$request->setJsonRequest( false );
if (!is_null($content_type)) {
$request->setHeader('Content-Type', $content_type);
}

$this->setRequest( $request );
$this->logDebug( "GET: " . $this->getRequestUrl( $query ) );
Expand Down
2 changes: 1 addition & 1 deletion src/Agreements.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function formData( $agreementId, $saveToPath )
{
$this->setApiRequestUrl( $agreementId . '/formData' );

return $this->saveFileRequest( $saveToPath );
return $this->saveFileRequest( $saveToPath, array(), 'application/json' );
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/Transports/GuzzleTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public function handleRequest( HttpRequest $httpRequest )
$options['multipart'] = $options['body'];
unset($options['body']);
}


$url = $httpRequest->getRequestUrl();

Expand Down

0 comments on commit c0bcdfd

Please sign in to comment.