com.paypal.cascade.http.util

HttpUtil

Related Doc: package util

object HttpUtil

Convenience methods for interacting with URLs and other parts of an HTTP request.

Methods found within spray.http objects should be preferred over these, wherever Spray objects are already in use. For example, if working with a spray.http.Uri, prefer to access its query string pairs using [spray.http.Uri.Query$.toMap] instead of using parseQueryStringToMap found here

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. HttpUtil
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. val CONTENT_LANGUAGE: String

  5. val CONTENT_LANGUAGE_LC: String

  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def errorResponse(e: Exception): HttpResponse

    Convenience method to return an exception as a 500 Internal Error with the body being the message of the exception

  11. val errorResponseType: ContentType

  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. def jsonOKResponse[T](t: T)(implicit arg0: Manifest[T]): HttpResponse

    Utility method to return HttpResponse with status OK and a serialized json body via Jackson.

    Utility method to return HttpResponse with status OK and a serialized json body via Jackson. If the JSON processing is CPU intensive, it should be done in a background thread, dedicated actor, etc... into an http body with the content type set

    T

    the type to serialize from

    t

    the object to serialize

    returns

    an HttpResponse containing an OK StatusCode and the serialized object

  17. def mergeParameters(m1: Map[String, List[String]], m2: Map[String, List[String]]): Map[String, List[String]]

    Merge two parameter maps into one

    Merge two parameter maps into one

    m1

    the first map

    m2

    the second map

    returns

    a merged map containing members from both maps

  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. def parseQueryStringToMap(queryString: String): Map[String, List[String]]

    Parse a query string into a Map of key-value String pairs.

    Parse a query string into a Map of key-value String pairs. Ignores invalid key-value pairs in the query string

    queryString

    the query string to parse, without the leading '?'

    returns

    key/value pairs mapping to the items in the query string

  22. def parseQueryStringToPairs(queryString: String): List[StrPair]

    Parse a query string into a List of key-value String pairs

    Parse a query string into a List of key-value String pairs

    queryString

    the query string to parse (without the '?')

    returns

    a list of (String, String), representing each key-value pair in the query string

  23. def parseType[T](r: HttpRequest, data: Array[Byte])(implicit arg0: Manifest[T]): Try[T]

  24. def parseType[T](r: HttpRequest, data: String)(implicit arg0: Manifest[T]): Try[T]

    Attempt to parse the incoming request.

    Attempt to parse the incoming request.

    r

    the full request

    data

    the piece of data that should be converted to the suggested type

    returns

    the parsed request, or a Failure response

  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  26. def toJsonBody[T](t: T)(implicit arg0: Manifest[T]): HttpEntity

    Utility method to serialize a json body via jackson.

    Utility method to serialize a json body via jackson. If the JSON processing is CPU intensive, it should be done in a background thread, dedicated actor, etc... into an http body with the content type set Enforces the return of application/json as a content type, since this always serializes to json

    T

    the type to serialize from

    t

    the object to serialize

    returns

    an HttpResponse containing either the desired HttpEntity, or an error entity with the quoted exception name

  27. def toString(): String

    Definition Classes
    AnyRef → Any
  28. def unauthorizedChallenge(req: HttpRequest): List[HttpChallenge]

    The message to be sent back with the WWW-Authenticate header when the request is unauthorized.

    The message to be sent back with the WWW-Authenticate header when the request is unauthorized. This particular form works around a known Android quirk.

    See discussion at http://stackoverflow.com/questions/6114455/

    returns

    the message

  29. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped