Class HttpUtil

java.lang.Object
org.opencastproject.util.HttpUtil

public final class HttpUtil extends Object
Functions to support Apache httpcomponents.
  • Field Details

    • getStatusCode

      public static final Function<org.apache.http.HttpResponse,Integer> getStatusCode
  • Method Details

    • post

      public static org.apache.http.client.methods.HttpPost post(org.apache.http.NameValuePair... formParams)
    • post

      public static org.apache.http.client.methods.HttpPost post(String uri, org.apache.http.NameValuePair... formParams)
    • get

      public static org.apache.http.client.methods.HttpGet get(String path, Tuple<String,String>... queryParams)
    • param

      public static org.apache.http.NameValuePair param(String name, String value)
    • isOk

      public static boolean isOk(org.apache.http.HttpResponse res)
    • waitForResource

      public static Either<Exception,Integer> waitForResource(TrustedHttpClient http, URI resourceUri, int expectedStatus, long timeout, long pollingInterval)
      Wait for a certain status of a resource.
      Returns:
      either an exception or the status code of the last http response