Skip to content

Change Accept Header #680

Closed
Closed

Description

@Moon-Hub

Like Issue #507 , working with the code-search, i want to change my accept header to the text-match header application/vnd.github.v3.text-match+json

Following along from the example in 507, my code:

// CONNECT TO API AND AUTHENTICATE SELF
$builder = new Github\HttpClient\Builder(new GuzzleClient());
$client = new \Github\Client($builder, 'application/vnd.github.v3.text-match+json');
$client->authenticate($user, $pwd, Github\Client::AUTH_HTTP_PASSWORD);

But, i'm greeted with: Fatal error: Uncaught Error: Class 'GuzzleClient' not found
So, what's wrong here?

Activity

  1. acrobat commented on Feb 16, 2018

    @acrobat
    Collaborator

    GuzzleClient is not an existing class but as alias. Add this to your code use Http\Adapter\Guzzle6\Client as GuzzleClient;

    We should also update the docs so the correct example code is used.

  2. Moon-Hub commented on Feb 16, 2018

    @Moon-Hub
    Author

    Funny, i was just about to post that i got my text-match to show but there was an issue with the builder, the use Http\Adapter\Guzzle6\Client as GuzzleClient has fixed it completely!

  3. acrobat commented on Feb 16, 2018

    @acrobat
    Collaborator

    I've fixed the docs in #679

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions