scamper.http
Members list
Packages
Type members
Classlikes
Provides access to decoded message body.
Provides access to decoded message body.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Provides factory for BodyDecoder
.
Provides factory for BodyDecoder
.
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
BodyDecoder.type
Provides utility for parsing message body.
Provides utility for parsing message body.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Provides factory for BodyParser
.
Provides factory for BodyParser
.
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
BodyParser.type
Defines body writer.
Defines body writer.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Provides input stream to HTTP entity.
Provides input stream to HTTP entity.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Indicates entity larger than established maximum length.
Indicates entity larger than established maximum length.
EntityTooLarge
is a complement to ReadLimitExceeded
. Whereas ReadLimitExceeded
applies to raw bytes of an input stream, EntityTooLarge
applies to a constructed entity, which is potentially subject to decompression.
Attributes
- See also
- Supertypes
-
trait Producttrait Equalsclass IOExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Defines HTTP header.
Indicates absence of specified header.
Indicates absence of specified header.
Attributes
- Supertypes
-
trait Producttrait Equalsclass HttpExceptionclass RuntimeExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Indicates exception in HTTP processing.
Indicates exception in HTTP processing.
Value parameters
- cause
-
underlying cause
- message
-
detail message
Attributes
- Constructor
-
Constructs HttpException with supplied detail message and cause.
- Supertypes
-
class RuntimeExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class RequestAbortedclass ParameterNotConvertibleclass ParameterNotFoundclass ResponseAbortedclass InvalidWebSocketRequestclass WebSocketErrorclass HeaderNotFoundShow all
Defines HTTP message.
Defines HTTP message.
HttpMessage
defines fundamental characteristics of an HTTP message. HttpRequest and HttpResponse extend the specification to define characteristics specific to their respective message types.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait HttpRequesttrait HttpResponse
Defines HTTP request.
Defines HTTP request.
A request is created using one of its factory methods, or you can start with a RequestMethod and build from there.
import scala.language.implicitConversions
import scamper.http.{ BodyParser, Header, stringToUri }
import scamper.http.RequestMethod.Registry.Get
val request = Get("/motd").setHeaders(
Header("Host: localhost:8080"),
Header("Accept: text/plain")
)
printf("Request Method: %s%n", request.method)
printf("Target URI: %s%n", request.target)
request.headers.foreach(println)
val host: Option[String] = request.getHeaderValue("Host")
given BodyParser[String] = BodyParser.string()
printf("Body: %s%n", request.as[String])
Attributes
- See also
- Companion
- object
- Supertypes
Provides factory for HttpRequest
.
Provides factory for HttpRequest
.
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
HttpRequest.type
Defines HTTP response.
Defines HTTP response.
A response is created using one of its factory methods, or you can start with a ResponseStatus and build from there.
import scala.language.implicitConversions
import scamper.http.{ BodyParser, Header, stringToEntity }
import scamper.http.ResponseStatus.Registry.Ok
val response = Ok("There is an answer.").setHeaders(
Header("Content-Type: text/plain"),
Header("Connection: close")
)
printf("Status Code: %d%n", response.statusCode)
printf("Reason Phrase: %s%n", response.reasonPhrase)
response.headers.foreach(println)
val contentType: Option[String] = response.getHeaderValue("Content-Type")
given BodyParser[String] = BodyParser.string()
printf("Body: %s%n", response.as[String])
Attributes
- See also
- Companion
- object
- Supertypes
Provides factory for HttpResponse
.
Provides factory for HttpResponse
.
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
HttpResponse.type
Defines HTTP version.
Provides factory for HttpVersion
.
Provides factory for HttpVersion
.
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
HttpVersion.type
Provides builder pattern for HTTP message.
Provides builder pattern for HTTP message.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait HttpRequesttrait HttpResponse
- Self type
-
T
Represents query string as mapped parameters.
Represents query string as mapped parameters.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Provides factory for QueryString
.
Provides factory for QueryString
.
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
QueryString.type
Indicates read of input stream exceeds established limit.
Indicates read of input stream exceeds established limit.
ReadLimitExceeded
is a complement to EntityTooLarge
. Whereas ReadLimitExceeded
applies to raw bytes of an input stream, EntityTooLarge
applies to a constructed entity, which is potentially subject to decompression.
Attributes
- See also
- Supertypes
-
trait Producttrait Equalsclass IOExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Defines HTTP request line.
Provides factory for RequestLine
.
Provides factory for RequestLine
.
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
RequestLine.type
Defines HTTP request method.
Defines HTTP request method.
Attributes
- See also
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Provides factory for RequestMethod
.
Provides factory for RequestMethod
.
Attributes
- See also
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
RequestMethod.type
Defines HTTP response status.
Defines HTTP response status.
Attributes
- See also
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Provides factory for ResponseStatus
.
Provides factory for ResponseStatus
.
Attributes
- See also
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ResponseStatus.type
Defines HTTP message start line.
Defines HTTP message start line.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait RequestLinetrait StatusLine
Defines HTTP status line.
Provides factory for StatusLine
.
Provides factory for StatusLine
.
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
StatusLine.type
Defines URI.
Defines URI builder.
Defines URI builder.
Attributes
- Constructor
-
Creates builder initialized to supplied URI.
- Supertypes
-
class Objecttrait Matchableclass Any
Givens
Givens
Converts int to ResponseStatus.
Converts string to RequestMethod.
Converts string to Uri
.
Converts string to Uri
.
Attributes
Extensions
Extensions
Gets first header with given name.
Gets first header with given name.
Attributes
Gets first header with given name, or returns default if header not present.
Gets first header with given name, or returns default if header not present.
Attributes
Gets first header value with given name.
Gets first header value with given name.
Attributes
Gets first header value with given name, or returns default if header not present.
Gets first header value with given name, or returns default if header not present.
Attributes
Gets header values with given name.
Gets header values with given name.
Attributes
Gets headers with given name.
Gets headers with given name.
Attributes
Tests for header with given name.
Tests for header with given name.
Attributes
Creates new message with supplied file as message body.
Creates new message with supplied file as message body.
Content-Type is set according to file name, and Content-Length is set to length of file.
Value parameters
- file
-
message body
Attributes
- See also
Creates new message with supplied query string as message body.
Creates new message with supplied query string as message body.
Content-Type is set to application/x-www-form-urlencoded
, and Content-Length is set to length of encoded form data.
Value parameters
- query
-
message body
Attributes
Creates new message with supplied form data as message body.
Creates new message with supplied form data as message body.
Content-Type is set to application/x-www-form-urlencoded
, and Content-Length is set to length of encoded form data.
Value parameters
- data
-
form data
- more
-
additional form data
Attributes
Creates new message with supplied bytes as message body.
Creates new message with supplied bytes as message body.
Content-Type is set to application/octet-stream
; Content-Length is set to length of bytes.
Value parameters
- bytes
-
message body
- charset
-
character set
Attributes
Creates new message with supplied text as message body.
Creates new message with supplied text as message body.
Content-Type is set to text/plain
with specified charset, and Content-Length is set to length of encoded text.
Value parameters
- charset
-
character set
- text
-
message body