All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.atmaramnaik.journey.http.rest.steps.RestStepWithBody Maven / Gradle / Ivy

There is a newer version: 0.0.7
Show newest version
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);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy