
com.despegar.http.client.WithBodyMethod Maven / Gradle / Ivy
package com.despegar.http.client;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
public abstract class WithBodyMethod extends HttpMethod {
private String body;
public WithBodyMethod(String url, String name, String body) {
super(url, name, true);
this.body = body;
}
@Override
protected void writeBody(HttpURLConnection connection) throws IOException {
OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
writer.write(this.body);
writer.close();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy