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

me.sniggle.matemonkey4j.BaseMateMonkeyUpdateCallable Maven / Gradle / Ivy

The newest version!
package me.sniggle.matemonkey4j;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URLConnection;

/**
 * @author tuxbox, sniggle.me
 *
 * performs a PUT request to the API
 *
 * @param 
 *    the type we sent as request body
 * @param 
 *    the type we expect as response
 */
public abstract class BaseMateMonkeyUpdateCallable extends BaseMateMonkeyCallable {

  /**
   *
   * @param restCallResult
   *    the class of the expected response
   * @param path
   *    the path of the API to query
   */
  protected BaseMateMonkeyUpdateCallable(Class restCallResult, String path) {
    super(restCallResult, path);
  }

  @Override
  protected URLConnection prepareCall(Body body) throws IOException {
    HttpURLConnection connection = (HttpURLConnection)super.prepareCall(body);
    connection.setRequestMethod("PUT");
    connection.setDoOutput(true);
    return connection;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy