Package

com.zengularity.benji

ws

Permalink

package ws

Visibility
  1. Public
  2. All

Value Members

  1. object ContentMD5 extends (ByteString) ⇒ String

    Permalink

    MD5 checksum utility.

  2. object Ok

    Permalink

    Extractor to match on successful HTTP response with OK status code.

    Extractor to match on successful HTTP response with OK status code.

    import play.api.libs.ws.StandaloneWSResponse
    import com.zengularity.benji.ws.Ok
    
    def ifOk[T](r: StandaloneWSResponse)(
      f: StandaloneWSResponse => T): Option[T] = r match {
      case Ok(resp) => Some(f(resp))
      case _ => None
    }
  3. object Successful

    Permalink

    Extractor to match on successful HTTP response, with OK, PARTIAL_CONTENT or NO_CONTENT status code.

    Extractor to match on successful HTTP response, with OK, PARTIAL_CONTENT or NO_CONTENT status code.

    import play.api.libs.ws.StandaloneWSResponse
    import com.zengularity.benji.ws.Successful
    
    def foo[T](r: StandaloneWSResponse)(
      ifSuc: StandaloneWSResponse => T): Option[T] = r match {
      case Successful(resp) => Some(ifSuc(resp))
      case _ => None
    }

Ungrouped