Skip to content

Make API client and buildURL method public #3

@Flynsarmy

Description

@Flynsarmy

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.

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