
net.anthavio.httl.api.HttlBody Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hatatitla Show documentation
Show all versions of hatatitla Show documentation
Compact but tweakable REST client library you have been dreaming of
The newest version!
package net.anthavio.httl.api;
import java.io.OutputStream;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
* @author martin.vanek
*
*/
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface HttlBody {
/**
* @return 'Content-Type' http request header value
*/
String value() default "";
/**
* @return Optional HttlBodyWriter to serialize request body
*/
Class extends HttlBodyWriter> writer() default NullSurrogateHttlBodyWriter.class;
/**
* Null surrogate class as annotation do not allow null...
*/
static class NullSurrogateHttlBodyWriter implements HttlBodyWriter {
@Override
public void write(T payload, OutputStream stream) {
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy