Skip to content

Commit

Permalink
Removed unused AblyRest request method
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Apr 17, 2022
1 parent 31a79eb commit 49ecf56
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/AblyRest.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,34 +217,6 @@ public function requestInternal( $method, $path, $headers = [], $params = [], $r
return $res;
}

/**
* Does an HTTP request with automatic pagination, automatically injected
* auth headers and automatic server failure handling using fallbackHosts.
*
* @param string $method HTTP method (GET, POST, PUT, DELETE, PATCH, ...)
* @param string $path root-relative path, e.g. /channels/example/messages
* @param array $params GET parameters to append to $path
* @param array|object $body JSON-encodable structure to send in the body - leave empty for GET requests
* @param array $headers HTTP headers to send
* @return \Ably\Models\HttpPaginatedResponse
* @throws AblyRequestException This exception is only thrown for status codes >= 500
*/
public function request( $method, $path, $params = [], $body = '', $headers = []) {
if ( count( $params ) ) {
$path .= '?' . http_build_query( $params );
}

if ( $method == 'GET' && $body ) {
throw new AblyException( 'GET requests cannot have a JSON body', 400, 40000 );
}

if ( !is_string( $body ) ) {
$body = json_encode( $body );
}

return new HttpPaginatedResponse( $this, 'Ably\Models\Untyped', null, $method, $path, $body, $headers );
}

/**
* Does a HTTP request backed up by fallback servers
*/
Expand Down

0 comments on commit 49ecf56

Please sign in to comment.