
com.banxa.model.request.PostRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-sdk Show documentation
Show all versions of java-sdk Show documentation
The Java SDK for integration with Banxa's API
package com.banxa.model.request;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
public abstract class PostRequest implements Request {
@Override
@JsonIgnore
public String getMethod() {
return "POST";
}
@Override
@JsonIgnore
public String getPayload() throws Exception {
ObjectMapper mapper = new ObjectMapper();
mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
mapper.setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL);
return mapper.writeValueAsString(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy