Skip to content

Configure object mappers per request #292

@codeswayslay

Description

@codeswayslay

Hi,

According to the documentation, "Object Mappers can be configured globally, per config, or on a per-request basis."

I'm trying to achieve a "per request" configuration. I tried this:

HttpResponse<ResponseSignUp> response = Unirest.post(signUpUrl)
                    .withObjectMapper(new JacksonObjectMapper())
                    .header("content-type", "application/json")
                    .header("Accept", "*/*")
                    .body(params)
                    .asObject(ResponseSignUp.class);

But all I keep getting is an exception telling me to use the global configuration:

kong.unirest.UnirestException: No Object Mapper Configured. Please config one with Unirest.config().setObjectMapper
Please, what am I missing?

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions