Class Http

java.lang.Object
com.github.mizosoft.methanol.internal.util.Http

public class Http extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isHeuristicallyCacheable(int statusCode)
    Returns whether a response with the given code can be cached based on heuristic expiry in case explicit expiry is absent.
    static boolean
    Returns whether the given request method is idempotent, and hence may be retried multiple times.
    static boolean
    isSafe(String method)
    Returns whether the given request method is unsafe, and hence may invalidate cached entries.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isHeuristicallyCacheable

      public static boolean isHeuristicallyCacheable(int statusCode)
      Returns whether a response with the given code can be cached based on heuristic expiry in case explicit expiry is absent. Based on rfc7231 Section 6.1.
    • isSafe

      public static boolean isSafe(String method)
      Returns whether the given request method is unsafe, and hence may invalidate cached entries. Based on rfc7231 Section 4.2.1.
    • isIdempotent

      public static boolean isIdempotent(String method)
      Returns whether the given request method is idempotent, and hence may be retried multiple times. Based on rfc7231 Section 4.2.2.