Skip to content

Document POST body example #978

@wulftone

Description

@wulftone

After a bunch of experimentation, I figured out that you can use a POJO as a POST body, but I couldn't find it anywhere in the documentation. e.g. You can do

public interface Boop {
    @RequestLine("POST /boop/{someParam}")
    @Headers({
        "Accept: application/json",
        "Content-Type: application/json"
    })
    BoopResponse createBoopUsingPOST(Boop boop, @Param("someParam") String someParam);

    class Boop {
        public String value;
    }
}

But the tricky part is that the POJO param (boop, in the example), must come first in the parameter list of the method. That was difficult to find out!

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationIssues that require updates to our documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions