Skip to content

Provide a generic to http put method #469

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

Merged
merged 1 commit into from
Oct 26, 2022
Merged

Conversation

alallema
Copy link
Contributor

Pull Request

What does this PR do?

Most of the methods had to use the jsonHandler after the call to the put method through the client. The purpose of this PR is to bypass this step to simplify the call to the put method via the client:

    Task updateDocuments(String uid, String document)
            throws MeilisearchException {
        String urlPath = "/indexes/" + uid + "/documents";
        Task task = httpClient.jsonHandler.decode(httpClient.put(urlPath, document), Task.class);

        return task;
    }

became

    Task updateDocuments(String uid, String document)
            throws MeilisearchException {
        String urlPath = "/indexes/" + uid + "/documents";
        return httpClient.put(urlPath, document, Task.class);
    }

@alallema alallema requested a review from brunoocasali October 25, 2022 12:51
Base automatically changed from patch-post-method to patch-get-method October 26, 2022 10:57
@alallema alallema merged commit 8f9e509 into patch-get-method Oct 26, 2022
@alallema alallema deleted the patch-put-method branch October 26, 2022 10:57
@alallema alallema added enhancement New feature or request skip-changelog The PR will not appear in the release changelogs labels Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request skip-changelog The PR will not appear in the release changelogs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants