Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make API client and buildURL method public #3

Open
Flynsarmy opened this issue Sep 28, 2023 · 0 comments
Open

Make API client and buildURL method public #3

Flynsarmy opened this issue Sep 28, 2023 · 0 comments

Comments

@Flynsarmy
Copy link

I'm needing to make some requests that you haven't implemented yet - namely posting a new status. Doing so is relatively easy with the following code:

$response = $api->client->request(
    "POST",
    $api->buildURL('statuses', []),
    [
        'headers' => [
            'Authorization' => "Bearer {$api->accessToken}",
        ],
        'form_params' => [
            'status' => "Status test",
        ]
    ]
);

However the client property and buildURL method of Fundevogel\Mastodon\Api needs to be made public for this to be possible. You could also provide a public getClient() method if you're worried about the property needing to be read only.

I understand your API once implemented will be much cleaner than what I have above, but it's nice to be able to make custom requests without needing to wait for the implementation.

This was referenced Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant