io.github.atmaramnaik.journey.http.rest.steps.RestStepWithBody Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of journey-http Show documentation
Show all versions of journey-http Show documentation
Http Module For Processing Workflows known as journeys
package io.github.atmaramnaik.journey.http.rest.steps;
import io.github.atmaramnaik.journey.core.data.runtime.Context;
import io.github.atmaramnaik.journey.core.io.IO;
import io.github.atmaramnaik.journey.template.template.Template;
import io.github.atmaramnaik.journey.template.template.text.Text;
import com.mashape.unirest.request.HttpRequestWithBody;
public abstract class RestStepWithBody extends RestStep {
Template body;
public RestStepWithBody(Text url, Template body) {
super(url);
this.body = body;
}
@Override
protected HttpRequestWithBody getHttpRequest(Context context, IO io) {
HttpRequestWithBody httpRequestWithBody=getHttpRequestWithBody(context,io);
httpRequestWithBody.body(body.process(context, io).serialize());
return httpRequestWithBody;
}
protected abstract HttpRequestWithBody getHttpRequestWithBody(Context context, IO io);
}