Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 86cbd5c141 | |||
| 84b9c5d64d | |||
| 4f402dbb57 |
@@ -1,412 +0,0 @@
|
||||
```
|
||||
/// HTTP Request NOT INCLUDING THE BODY. This allows for streaming
|
||||
public struct HTTPRequest {
|
||||
public var method : HTTPMethod
|
||||
public var target : String /* e.g. "/foo/bar?buz=qux" */
|
||||
public var httpVersion : HTTPVersion
|
||||
public var headers : HTTPHeaders
|
||||
}
|
||||
|
||||
/// Object that code writes the response and response body to.
|
||||
public protocol HTTPResponseWriter : class {
|
||||
func writeHeader(status: HTTPResponseStatus, headers: HTTPHeaders, completion: @escaping (Result) -> Void)
|
||||
func writeTrailer(_ trailers: HTTPHeaders, completion: @escaping (Result) -> Void)
|
||||
func writeBody(_ data: UnsafeHTTPResponseBody, completion: @escaping (Result) -> Void)
|
||||
func done(completion: @escaping (Result) -> Void)
|
||||
func abort()
|
||||
}
|
||||
|
||||
/// Convenience methods for HTTP response writer.
|
||||
extension HTTPResponseWriter {
|
||||
public func writeHeader(status: HTTPResponseStatus, headers: HTTPHeaders)
|
||||
public func writeHeader(status: HTTPResponseStatus)
|
||||
public func writeTrailer(_ trailers: HTTPHeaders)
|
||||
public func writeBody(_ data: UnsafeHTTPResponseBody)
|
||||
public func done()
|
||||
}
|
||||
|
||||
public protocol UnsafeHTTPResponseBody {
|
||||
func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R
|
||||
}
|
||||
|
||||
extension UnsafeRawBufferPointer : UnsafeHTTPResponseBody {
|
||||
public func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R
|
||||
}
|
||||
|
||||
public protocol HTTPResponseBody : UnsafeHTTPResponseBody {}
|
||||
|
||||
extension Data : HTTPResponseBody {
|
||||
public func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R
|
||||
}
|
||||
|
||||
extension DispatchData : HTTPResponseBody {
|
||||
public func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R
|
||||
}
|
||||
|
||||
extension String : HTTPResponseBody {
|
||||
public func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R
|
||||
}
|
||||
|
||||
/// Method that takes a chunk of request body and is expected to write to the ResponseWriter
|
||||
public typealias HTTPBodyHandler = (HTTPBodyChunk, inout Bool) -> Void /* the Bool can be set to true when we don't want to process anything further */
|
||||
|
||||
/// Indicates whether the body is going to be processed or ignored
|
||||
public enum HTTPBodyProcessing {
|
||||
case discardBody /* if you're not interested in the body */
|
||||
case processBody(handler: HTTPBodyHandler)
|
||||
}
|
||||
|
||||
/// Part (or maybe all) of the incoming request body
|
||||
public enum HTTPBodyChunk {
|
||||
case chunk(data: DispatchData, finishedProcessing: () -> Void) /* a new bit of the HTTP request body has arrived, finishedProcessing() must be called when done with that chunk */
|
||||
case failed(error: /*HTTPParser*/ Error) /* error while streaming the HTTP request body, eg. connection closed */
|
||||
case trailer(key: String, value: String) /* trailer has arrived (this we actually haven't implemented yet) */
|
||||
case end /* body and trailers finished */
|
||||
}
|
||||
|
||||
/// Headers structure.
|
||||
public struct HTTPHeaders : Sequence, ExpressibleByDictionaryLiteral {
|
||||
public subscript(name: Name) -> String?
|
||||
public subscript(valuesFor name: Name) -> [String]
|
||||
|
||||
public struct Literal : ExpressibleByDictionaryLiteral { }
|
||||
public mutating func append(_ literal: HTTPHeaders.Literal)
|
||||
public mutating func replace(_ literal: HTTPHeaders.Literal)
|
||||
|
||||
public func makeIterator() -> AnyIterator<(name: Name, value: String)>
|
||||
|
||||
public struct Name : Hashable, ExpressibleByStringLiteral, CustomStringConvertible {
|
||||
public init(_ name: String)
|
||||
|
||||
// https://www.iana.org/assignments/message-headers/message-headers.xhtml
|
||||
// Permanent Message Header Field Names
|
||||
public static let aIM
|
||||
public static let accept
|
||||
public static let acceptAdditions
|
||||
public static let acceptCharset
|
||||
public static let acceptDatetime
|
||||
public static let acceptEncoding
|
||||
public static let acceptFeatures
|
||||
public static let acceptLanguage
|
||||
public static let acceptPatch
|
||||
public static let acceptPost
|
||||
public static let acceptRanges
|
||||
public static let age
|
||||
public static let allow
|
||||
public static let alpn
|
||||
public static let altSvc
|
||||
public static let altUsed
|
||||
public static let alternates
|
||||
public static let applyToRedirectRef
|
||||
public static let authenticationControl
|
||||
public static let authenticationInfo
|
||||
public static let authorization
|
||||
public static let cExt
|
||||
public static let cMan
|
||||
public static let cOpt
|
||||
public static let cPEP
|
||||
public static let cPEPInfo
|
||||
public static let cacheControl
|
||||
public static let calDAVTimezones
|
||||
public static let close
|
||||
public static let connection
|
||||
public static let contentBase
|
||||
public static let contentDisposition
|
||||
public static let contentEncoding
|
||||
public static let contentID
|
||||
public static let contentLanguage
|
||||
public static let contentLength
|
||||
public static let contentLocation
|
||||
public static let contentMD5
|
||||
public static let contentRange
|
||||
public static let contentScriptType
|
||||
public static let contentStyleType
|
||||
public static let contentType
|
||||
public static let contentVersion
|
||||
public static let cookie
|
||||
public static let cookie2
|
||||
public static let dasl
|
||||
public static let dav
|
||||
public static let date
|
||||
public static let defaultStyle
|
||||
public static let deltaBase
|
||||
public static let depth
|
||||
public static let derivedFrom
|
||||
public static let destination
|
||||
public static let differentialID
|
||||
public static let digest
|
||||
public static let eTag
|
||||
public static let expect
|
||||
public static let expires
|
||||
public static let ext
|
||||
public static let forwarded
|
||||
public static let from
|
||||
public static let getProfile
|
||||
public static let hobareg
|
||||
public static let host
|
||||
public static let http2Settings
|
||||
public static let im
|
||||
public static let `if`
|
||||
public static let ifMatch
|
||||
public static let ifModifiedSince
|
||||
public static let ifNoneMatch
|
||||
public static let ifRange
|
||||
public static let ifScheduleTagMatch
|
||||
public static let ifUnmodifiedSince
|
||||
public static let keepAlive
|
||||
public static let label
|
||||
public static let lastModified
|
||||
public static let link
|
||||
public static let location
|
||||
public static let lockToken
|
||||
public static let man
|
||||
public static let maxForwards
|
||||
public static let mementoDatetime
|
||||
public static let meter
|
||||
public static let mimeVersion
|
||||
public static let negotiate
|
||||
public static let opt
|
||||
public static let optionalWWWAuthenticate
|
||||
public static let orderingType
|
||||
public static let origin
|
||||
public static let overwrite
|
||||
public static let p3p
|
||||
public static let pep
|
||||
public static let picsLabel
|
||||
public static let pepInfo
|
||||
public static let position
|
||||
public static let pragma
|
||||
public static let prefer
|
||||
public static let preferenceApplied
|
||||
public static let profileObject
|
||||
public static let `protocol`
|
||||
public static let protocolInfo
|
||||
public static let protocolQuery
|
||||
public static let protocolRequest
|
||||
public static let proxyAuthenticate
|
||||
public static let proxyAuthenticationInfo
|
||||
public static let proxyAuthorization
|
||||
public static let proxyFeatures
|
||||
public static let proxyInstruction
|
||||
public static let `public`
|
||||
public static let publicKeyPins
|
||||
public static let publicKeyPinsReportOnly
|
||||
public static let range
|
||||
public static let redirectRef
|
||||
public static let referer
|
||||
public static let retryAfter
|
||||
public static let safe
|
||||
public static let scheduleReply
|
||||
public static let scheduleTag
|
||||
public static let secWebSocketAccept
|
||||
public static let secWebSocketExtensions
|
||||
public static let secWebSocketKey
|
||||
public static let secWebSocketProtocol
|
||||
public static let secWebSocketVersion
|
||||
public static let securityScheme
|
||||
public static let server
|
||||
public static let setCookie
|
||||
public static let setCookie2
|
||||
public static let setProfile
|
||||
public static let slug
|
||||
public static let soapAction
|
||||
public static let statusURI
|
||||
public static let strictTransportSecurity
|
||||
public static let surrogateCapability
|
||||
public static let surrogateControl
|
||||
public static let tcn
|
||||
public static let te
|
||||
public static let timeout
|
||||
public static let topic
|
||||
public static let trailer
|
||||
public static let transferEncoding
|
||||
public static let ttl
|
||||
public static let urgency
|
||||
public static let uri
|
||||
public static let upgrade
|
||||
public static let userAgent
|
||||
public static let variantVary
|
||||
public static let vary
|
||||
public static let via
|
||||
public static let wwwAuthenticate
|
||||
public static let wantDigest
|
||||
public static let warning
|
||||
public static let xFrameOptions
|
||||
|
||||
// https://www.iana.org/assignments/message-headers/message-headers.xhtml
|
||||
// Provisional Message Header Field Names
|
||||
public static let accessControl
|
||||
public static let accessControlAllowCredentials
|
||||
public static let accessControlAllowHeaders
|
||||
public static let accessControlAllowMethods
|
||||
public static let accessControlAllowOrigin
|
||||
public static let accessControlMaxAge
|
||||
public static let accessControlRequestMethod
|
||||
public static let accessControlRequestHeaders
|
||||
public static let compliance
|
||||
public static let contentTransferEncoding
|
||||
public static let cost
|
||||
public static let ediintFeatures
|
||||
public static let messageID
|
||||
public static let methodCheck
|
||||
public static let methodCheckExpires
|
||||
public static let nonCompliance
|
||||
public static let optional
|
||||
public static let refererRoot
|
||||
public static let resolutionHint
|
||||
public static let resolverLocation
|
||||
public static let subOK
|
||||
public static let subst
|
||||
public static let title
|
||||
public static let uaColor
|
||||
public static let uaMedia
|
||||
public static let uaPixels
|
||||
public static let uaResolution
|
||||
public static let uaWindowpixels
|
||||
public static let version
|
||||
public static let xDeviceAccept
|
||||
public static let xDeviceAcceptCharset
|
||||
public static let xDeviceAcceptEncoding
|
||||
public static let xDeviceAcceptLanguage
|
||||
public static let xDeviceUserAgent
|
||||
}
|
||||
}
|
||||
|
||||
/// Version number of the HTTP Protocol
|
||||
public struct HTTPVersion {
|
||||
/// Major version component.
|
||||
public var major: Int
|
||||
/// Minor version component.
|
||||
public var minor: Int
|
||||
|
||||
public init(major: Int, minor: Int)
|
||||
}
|
||||
|
||||
public enum HTTPTransferEncoding {
|
||||
case identity(contentLength: UInt)
|
||||
case chunked
|
||||
}
|
||||
|
||||
/// Response status (200 ok, 404 not found, etc)
|
||||
public struct HTTPResponseStatus: Equatable, CustomStringConvertible, ExpressibleByIntegerLiteral {
|
||||
public let code: Int
|
||||
public let reasonPhrase: String
|
||||
|
||||
public init(code: Int, reasonPhrase: String)
|
||||
public init(code: Int)
|
||||
|
||||
/* all the codes from http://www.iana.org/assignments/http-status-codes */
|
||||
public static let `continue`
|
||||
public static let switchingProtocols
|
||||
public static let ok
|
||||
public static let created
|
||||
public static let accepted
|
||||
public static let nonAuthoritativeInformation
|
||||
public static let noContent
|
||||
public static let resetContent
|
||||
public static let partialContent
|
||||
public static let multiStatus
|
||||
public static let alreadyReported
|
||||
public static let imUsed
|
||||
public static let multipleChoices
|
||||
public static let movedPermanently
|
||||
public static let found
|
||||
public static let seeOther
|
||||
public static let notModified
|
||||
public static let useProxy
|
||||
public static let temporaryRedirect
|
||||
public static let permanentRedirect
|
||||
public static let badRequest
|
||||
public static let unauthorized
|
||||
public static let paymentRequired
|
||||
public static let forbidden
|
||||
public static let notFound
|
||||
public static let methodNotAllowed
|
||||
public static let notAcceptable
|
||||
public static let proxyAuthenticationRequired
|
||||
public static let requestTimeout
|
||||
public static let conflict
|
||||
public static let gone
|
||||
public static let lengthRequired
|
||||
public static let preconditionFailed
|
||||
public static let payloadTooLarge
|
||||
public static let uriTooLong
|
||||
public static let unsupportedMediaType
|
||||
public static let rangeNotSatisfiable
|
||||
public static let expectationFailed
|
||||
public static let misdirectedRequest
|
||||
public static let unprocessableEntity
|
||||
public static let locked
|
||||
public static let failedDependency
|
||||
public static let upgradeRequired
|
||||
public static let preconditionRequired
|
||||
public static let tooManyRequests
|
||||
public static let requestHeaderFieldsTooLarge
|
||||
public static let unavailableForLegalReasons
|
||||
public static let internalServerError
|
||||
public static let notImplemented
|
||||
public static let badGateway
|
||||
public static let serviceUnavailable
|
||||
public static let gatewayTimeout
|
||||
public static let httpVersionNotSupported
|
||||
public static let variantAlsoNegotiates
|
||||
public static let insufficientStorage
|
||||
public static let loopDetected
|
||||
public static let notExtended
|
||||
public static let networkAuthenticationRequired
|
||||
|
||||
public var `class`: Class
|
||||
|
||||
public enum Class {
|
||||
case informational
|
||||
case successful
|
||||
case redirection
|
||||
case clientError
|
||||
case serverError
|
||||
case invalidStatus
|
||||
}
|
||||
}
|
||||
|
||||
/// HTTP Methods handled by http_parser.[ch] supports
|
||||
public struct HTTPMethod : Hashable, CustomStringConvertible, ExpressibleByIntegerLiteral {
|
||||
|
||||
public let method: String
|
||||
|
||||
public init(_ method: String)
|
||||
|
||||
/* Constants for everything that http_parser.[ch] supports */
|
||||
public static let delete
|
||||
public static let get
|
||||
public static let head
|
||||
public static let post
|
||||
public static let put
|
||||
public static let connect
|
||||
public static let options
|
||||
public static let trace
|
||||
public static let copy
|
||||
public static let lock
|
||||
public static let mkol
|
||||
public static let move
|
||||
public static let propfind
|
||||
public static let proppatch
|
||||
public static let search
|
||||
public static let unlock
|
||||
public static let bind
|
||||
public static let rebind
|
||||
public static let unbind
|
||||
public static let acl
|
||||
public static let report
|
||||
public static let mkactivity
|
||||
public static let checkout
|
||||
public static let merge
|
||||
public static let msearch
|
||||
public static let notify
|
||||
public static let subscribe
|
||||
public static let unsubscribe
|
||||
public static let patch
|
||||
public static let purge
|
||||
public static let mkcalendar
|
||||
public static let link
|
||||
public static let unlink
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,417 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>BlueSocketConnectionListener Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Class/BlueSocketConnectionListener" class="dashAnchor"></a>
|
||||
|
||||
<a title="BlueSocketConnectionListener Class Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="../index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(99% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="../index.html">HTTP Reference</a>
|
||||
<img class="carat" src="../img/carat.png" />
|
||||
BlueSocketConnectionListener Class Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Classes.html">Other Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/BlueSocketConnectionListener.html">BlueSocketConnectionListener</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/BlueSocketSimpleServer.html">BlueSocketSimpleServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Extensions.html">Other Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Extensions/UnsafeRawBufferPointer.html">UnsafeRawBufferPointer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Protocols.html">Other Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>BlueSocketConnectionListener</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">BlueSocketConnectionListener</span><span class="p">:</span> <span class="kt">ParserConnecting</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>The Interface between the StreamingParser class and IBM’s BlueSocket wrapper around socket(2).
|
||||
You hopefully should be able to replace this with any network library/engine.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerCAC0C0ADC6socket_AA15StreamingParserC6parserSo13DispatchQueueC04readK0AK05writeK0tcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(socket:parser:readQueue:writeQueue:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerCAC0C0ADC6socket_AA15StreamingParserC6parserSo13DispatchQueueC04readK0AK05writeK0tcfc">init(socket:parser:readQueue:writeQueue:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>initializer</p>
|
||||
|
||||
<ul>
|
||||
<li>Parameters:
|
||||
|
||||
<ul>
|
||||
<li>socket: Socket object from BlueSocket library wrapping a socket(2)</li>
|
||||
<li>parser: Manager of the CHTTPParser library</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">socket</span><span class="p">:</span> <span class="kt">Socket</span><span class="p">,</span> <span class="nv">parser</span><span class="p">:</span> <span class="kt">StreamingParser</span><span class="p">,</span> <span class="nv">readQueue</span><span class="p">:</span> <span class="kt">DispatchQueue</span><span class="p">,</span> <span class="nv">writeQueue</span><span class="p">:</span> <span class="kt">DispatchQueue</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC6isOpenSbv"></a>
|
||||
<a name="//apple_ref/swift/Property/isOpen" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC6isOpenSbv">isOpen</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Check if socket is still open. Used to decide whether it should be closed/pruned after timeout</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isOpen</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC11closeWriteryyF"></a>
|
||||
<a name="//apple_ref/swift/Method/closeWriter()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC11closeWriteryyF">closeWriter()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Called by the parser to let us know that it’s done with this socket</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">closeWriter</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC17responseBeginningyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/responseBeginning()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC17responseBeginningyyF">responseBeginning()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Called by the parser to let us know that a response has started being created</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">responseBeginning</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC16responseCompleteyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/responseComplete()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC16responseCompleteyyF">responseComplete()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Called by the parser to let us know that a response is complete, and we can close after timeout</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">responseComplete</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC7processyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/process()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC7processyyF">process()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Starts reading from the socket and feeding that data to the parser</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">process</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC05queueC5Writey10Foundation4DataVF"></a>
|
||||
<a name="//apple_ref/swift/Method/queueSocketWrite(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC05queueC5Writey10Foundation4DataVF">queueSocketWrite(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Called by the parser to give us data to send back out of the socket</p>
|
||||
|
||||
<div class="aside aside-parameter">
|
||||
<p class="aside-title">Parameter</p>
|
||||
Parameter bytes: Data object to be queued to be written to the socket
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">queueSocketWrite</span><span class="p">(</span><span class="n">_</span> <span class="nv">bytes</span><span class="p">:</span> <span class="kt">Data</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC5writey10Foundation4DataVF"></a>
|
||||
<a name="//apple_ref/swift/Method/write(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC5writey10Foundation4DataVF">write(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Write data to a socket. Should be called in an <code>async</code> block on the <code>socketWriterQueue</code></p>
|
||||
|
||||
<div class="aside aside-parameter">
|
||||
<p class="aside-title">Parameter</p>
|
||||
Parameter data: data to be written
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">write</span><span class="p">(</span><span class="n">_</span> <span class="nv">data</span><span class="p">:</span><span class="kt">Data</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-08-23)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,326 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>BlueSocketSimpleServer Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Class/BlueSocketSimpleServer" class="dashAnchor"></a>
|
||||
|
||||
<a title="BlueSocketSimpleServer Class Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="../index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(99% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="../index.html">HTTP Reference</a>
|
||||
<img class="carat" src="../img/carat.png" />
|
||||
BlueSocketSimpleServer Class Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Classes.html">Other Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/BlueSocketConnectionListener.html">BlueSocketConnectionListener</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/BlueSocketSimpleServer.html">BlueSocketSimpleServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Extensions.html">Other Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Extensions/UnsafeRawBufferPointer.html">UnsafeRawBufferPointer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Protocols.html">Other Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>BlueSocketSimpleServer</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">BlueSocketSimpleServer</span> <span class="p">:</span> <span class="kt">CurrentConnectionCounting</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>An HTTP server that listens for connections on a TCP socket and spawns Listeners to handle them.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP22BlueSocketSimpleServerC4portSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/port" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP22BlueSocketSimpleServerC4portSiv">port</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The port we’re listening on. Used primarily to query a randomly assigned port during XCTests</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">port</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP22BlueSocketSimpleServerCACycfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP22BlueSocketSimpleServerCACycfc">init()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">BlueSocketSimpleServer</span> <span class="p">:</span> <span class="kt">CurrentConnectionCounting</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP22BlueSocketSimpleServerC5startySi4port_Si10queueCountSi06acceptI0AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF"></a>
|
||||
<a name="//apple_ref/swift/Method/start(port:queueCount:acceptCount:handler:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP22BlueSocketSimpleServerC5startySi4port_Si10queueCountSi06acceptI0AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF">start(port:queueCount:acceptCount:handler:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Starts the server listening on a given port</p>
|
||||
|
||||
<p><li>Parameters:</p>
|
||||
|
||||
<p><ul>
|
||||
<li>port: TCP port. See listen(2)</li>
|
||||
<li>handler: Function that creates the HTTP Response from the HTTP Request</li>
|
||||
</ul></li>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
Error (usually a socket error) generated</p>
|
||||
|
||||
<p></div></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">start</span><span class="p">(</span><span class="nv">port</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">queueCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">acceptCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">handler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt"><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></span><span class="p">)</span> <span class="k">throws</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP22BlueSocketSimpleServerC4stopyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/stop()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP22BlueSocketSimpleServerC4stopyyF">stop()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Stop the server and close the sockets</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">stop</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP22BlueSocketSimpleServerC15connectionCountSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/connectionCount" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP22BlueSocketSimpleServerC15connectionCountSiv">connectionCount</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Count the connections - can be used in XCTests</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">connectionCount</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-08-23)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,301 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>HTTPServer Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
<script src="../js/lunr.min.js" defer></script>
|
||||
<script src="../js/typeahead.jquery.js" defer></script>
|
||||
<script src="../js/jazzy.search.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Class/HTTPServer" class="dashAnchor"></a>
|
||||
|
||||
<a title="HTTPServer Class Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="../index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(100% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col--secondary">
|
||||
<form role="search" action="../search.json">
|
||||
<input type="text" placeholder="Search documentation" data-typeahead>
|
||||
</form>
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="../index.html">HTTP Reference</a>
|
||||
<img class="carat" src="../img/carat.png" />
|
||||
HTTPServer Class Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>HTTPServer</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">HTTPServer</span><span class="p">:</span> <span class="kt"><a href="../Protocols/HTTPServing.html">HTTPServing</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>A basic HTTP server. Currently this is implemented using the PoCSocket
|
||||
abstraction, but the intention is to remove this dependency and reimplement
|
||||
the class using transport APIs provided by the Server APIs working group.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP10HTTPServerCACycfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPServerCACycfc">init()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Create an instance of the server. This needs to be followed with a call to <code><a href="../Classes/HTTPServer.html#/s:4HTTP10HTTPServerC5startySi4port_AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF">start(port:handler:)</a></code></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP10HTTPServerC5startySi4port_AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF"></a>
|
||||
<a name="//apple_ref/swift/Method/start(port:handler:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPServerC5startySi4port_AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF">start(port:handler:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Start the HTTP server on the given <code><a href="../Classes/HTTPServer.html#/s:4HTTP10HTTPServerC4portSiv">port</a></code> number, using a <code><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></code> to process incoming requests.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">start</span><span class="p">(</span><span class="nv">port</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">handler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt"><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></span><span class="p">)</span> <span class="k">throws</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP10HTTPServerC4stopyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/stop()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPServerC4stopyyF">stop()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Stop the server</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">stop</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP10HTTPServerC4portSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/port" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPServerC4portSiv">port</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The port number the server is listening on</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">port</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP10HTTPServerC15connectionCountSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/connectionCount" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPServerC15connectionCountSiv">connectionCount</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The number of current connections</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">connectionCount</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP13HTTPBodyChunk5chunkFMS0_FT4dataV8Dispatch12DispatchData18finishedProcessingFT_T__S0_"></a>
|
||||
<a name="/s:4HTTP13HTTPBodyChunkO5chunkAC8Dispatch0E4DataV4data_yyc18finishedProcessingtcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/chunk" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP13HTTPBodyChunk5chunkFMS0_FT4dataV8Dispatch12DispatchData18finishedProcessingFT_T__S0_">chunk</a>
|
||||
<a class="token" href="#/s:4HTTP13HTTPBodyChunkO5chunkAC8Dispatch0E4DataV4data_yyc18finishedProcessingtcACmF">chunk</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -177,9 +183,9 @@ that chunk has been processed.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP13HTTPBodyChunk6failedFMS0_FT5errorPs5Error__S0_"></a>
|
||||
<a name="/s:4HTTP13HTTPBodyChunkO6failedACs5Error_p5error_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/failed" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP13HTTPBodyChunk6failedFMS0_FT5errorPs5Error__S0_">failed</a>
|
||||
<a class="token" href="#/s:4HTTP13HTTPBodyChunkO6failedACs5Error_p5error_tcACmF">failed</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -208,9 +214,9 @@ that chunk has been processed.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP13HTTPBodyChunk7trailerFMS0_FT3keySS5valueSS_S0_"></a>
|
||||
<a name="/s:4HTTP13HTTPBodyChunkO7trailerACSS3key_SS5valuetcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/trailer" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP13HTTPBodyChunk7trailerFMS0_FT3keySS5valueSS_S0_">trailer</a>
|
||||
<a class="token" href="#/s:4HTTP13HTTPBodyChunkO7trailerACSS3key_SS5valuetcACmF">trailer</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -240,9 +246,9 @@ This is currently unimplemented.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP13HTTPBodyChunk3endFMS0_S0_"></a>
|
||||
<a name="/s:4HTTP13HTTPBodyChunkO3endA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/end" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP13HTTPBodyChunk3endFMS0_S0_">end</a>
|
||||
<a class="token" href="#/s:4HTTP13HTTPBodyChunkO3endA2CmF">end</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -272,7 +278,7 @@ This is currently unimplemented.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP18HTTPBodyProcessing11discardBodyFMS0_S0_"></a>
|
||||
<a name="/s:4HTTP18HTTPBodyProcessingO11discardBodyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/discardBody" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP18HTTPBodyProcessing11discardBodyFMS0_S0_">discardBody</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPBodyProcessingO11discardBodyA2CmF">discardBody</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -176,9 +182,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP18HTTPBodyProcessing11processBodyFMS0_FT7handlerFTOS_13HTTPBodyChunkRSb_T__S0_"></a>
|
||||
<a name="/s:4HTTP18HTTPBodyProcessingO11processBodyACyAA0B5ChunkO_Sbztc7handler_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/processBody" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP18HTTPBodyProcessing11processBodyFMS0_FT7handlerFTOS_13HTTPBodyChunkRSb_T__S0_">processBody</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPBodyProcessingO11processBodyACyAA0B5ChunkO_Sbztc7handler_tcACmF">processBody</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -186,14 +192,14 @@
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Used to process the body data associated with the imcoming HTTP request using a <code><a href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a></code></p>
|
||||
<p>Used to process the body data associated with the imcoming HTTP request using a <code><a href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a></code></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">processBody</span><span class="p">(</span><span class="nv">handler</span><span class="p">:</span> <span class="kt"><a href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a></span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">processBody</span><span class="p">(</span><span class="nv">handler</span><span class="p">:</span> <span class="kt"><a href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a></span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -208,7 +214,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP6Result2okFMS0_S0_"></a>
|
||||
<a name="/s:4HTTP6ResultO2okA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/ok" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP6Result2okFMS0_S0_">ok</a>
|
||||
<a class="token" href="#/s:4HTTP6ResultO2okA2CmF">ok</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -176,9 +182,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP6Result5errorFMS0_FPs5Error_S0_"></a>
|
||||
<a name="/s:4HTTP6ResultO5errorACs5Error_pcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/error" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP6Result5errorFMS0_FPs5Error_S0_">error</a>
|
||||
<a class="token" href="#/s:4HTTP6ResultO5errorACs5Error_pcACmF">error</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -208,7 +214,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -0,0 +1,205 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>UnsafeRawBufferPointer Extension Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Extension/UnsafeRawBufferPointer" class="dashAnchor"></a>
|
||||
|
||||
<a title="UnsafeRawBufferPointer Extension Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="../index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(99% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="../index.html">HTTP Reference</a>
|
||||
<img class="carat" src="../img/carat.png" />
|
||||
UnsafeRawBufferPointer Extension Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Classes.html">Other Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/BlueSocketConnectionListener.html">BlueSocketConnectionListener</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/BlueSocketSimpleServer.html">BlueSocketSimpleServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Extensions.html">Other Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Extensions/UnsafeRawBufferPointer.html">UnsafeRawBufferPointer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Protocols.html">Other Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>UnsafeRawBufferPointer</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">struct</span> <span class="kt">UnsafeRawBufferPointer</span> <span class="p">:</span> <span class="kt">Collection</span><span class="p">,</span> <span class="kt">RandomAccessCollection</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:s22UnsafeRawBufferPointerV4HTTPE04withA5BytesxxABKcKlF"></a>
|
||||
<a name="//apple_ref/swift/Method/withUnsafeBytes(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:s22UnsafeRawBufferPointerV4HTTPE04withA5BytesxxABKcKlF">withUnsafeBytes(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">struct</span> <span class="kt">UnsafeRawBufferPointer</span> <span class="p">:</span> <span class="kt">Collection</span><span class="p">,</span> <span class="kt">RandomAccessCollection</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-08-23)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -32,7 +32,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -53,10 +53,16 @@
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -84,7 +90,7 @@
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -137,9 +143,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:V4HTTP11HTTPHeaders"></a>
|
||||
<a name="/s:4HTTP11HTTPHeadersV"></a>
|
||||
<a name="//apple_ref/swift/Struct/HTTPHeaders" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:V4HTTP11HTTPHeaders">HTTPHeaders</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPHeadersV">HTTPHeaders</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -176,9 +182,9 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:V4HTTP11HTTPVersion"></a>
|
||||
<a name="/s:4HTTP11HTTPVersionV"></a>
|
||||
<a name="//apple_ref/swift/Struct/HTTPVersion" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:V4HTTP11HTTPVersion">HTTPVersion</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPVersionV">HTTPVersion</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -209,7 +215,7 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -32,7 +32,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -53,10 +53,16 @@
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -84,7 +90,7 @@
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -137,9 +143,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:V4HTTP11HTTPRequest"></a>
|
||||
<a name="/s:4HTTP11HTTPRequestV"></a>
|
||||
<a name="//apple_ref/swift/Struct/HTTPRequest" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:V4HTTP11HTTPRequest">HTTPRequest</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPRequestV">HTTPRequest</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -165,9 +171,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP15HTTPBodyHandler"></a>
|
||||
<a name="/s:4HTTP15HTTPBodyHandlera"></a>
|
||||
<a name="//apple_ref/swift/Alias/HTTPBodyHandler" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="token" href="#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -175,7 +181,7 @@
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Method that takes a chunk of request body and is expected to write to the ResponseWriter</p>
|
||||
<p>Method that takes a chunk of request body and is expected to write to the <code><a href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a></code></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -210,7 +216,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Bool that can be set to true in order to prevent further processing</p>
|
||||
<p>A boolean flag that can be set to true in order to prevent further processing</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -223,9 +229,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:O4HTTP18HTTPBodyProcessing"></a>
|
||||
<a name="/s:4HTTP18HTTPBodyProcessingO"></a>
|
||||
<a name="//apple_ref/swift/Enum/HTTPBodyProcessing" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:O4HTTP18HTTPBodyProcessing">HTTPBodyProcessing</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPBodyProcessingO">HTTPBodyProcessing</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -251,9 +257,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:O4HTTP13HTTPBodyChunk"></a>
|
||||
<a name="/s:4HTTP13HTTPBodyChunkO"></a>
|
||||
<a name="//apple_ref/swift/Enum/HTTPBodyChunk" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:O4HTTP13HTTPBodyChunk">HTTPBodyChunk</a>
|
||||
<a class="token" href="#/s:4HTTP13HTTPBodyChunkO">HTTPBodyChunk</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -283,9 +289,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:V4HTTP10HTTPMethod"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV"></a>
|
||||
<a name="//apple_ref/swift/Struct/HTTPMethod" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:V4HTTP10HTTPMethod">HTTPMethod</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV">HTTPMethod</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -316,7 +322,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -32,7 +32,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -53,10 +53,16 @@
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -84,7 +90,7 @@
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -137,9 +143,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:V4HTTP12HTTPResponse"></a>
|
||||
<a name="/s:4HTTP12HTTPResponseV"></a>
|
||||
<a name="//apple_ref/swift/Struct/HTTPResponse" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:V4HTTP12HTTPResponse">HTTPResponse</a>
|
||||
<a class="token" href="#/s:4HTTP12HTTPResponseV">HTTPResponse</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -165,9 +171,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:V4HTTP18HTTPResponseStatus"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV"></a>
|
||||
<a name="//apple_ref/swift/Struct/HTTPResponseStatus" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:V4HTTP18HTTPResponseStatus">HTTPResponseStatus</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV">HTTPResponseStatus</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -198,9 +204,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:P4HTTP18HTTPResponseWriter"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterP"></a>
|
||||
<a name="//apple_ref/swift/Protocol/HTTPResponseWriter" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:P4HTTP18HTTPResponseWriter">HTTPResponseWriter</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterP">HTTPResponseWriter</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -231,7 +237,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -32,7 +32,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -53,10 +53,16 @@
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -84,7 +90,7 @@
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -137,9 +143,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:P4HTTP16WebAppContaining"></a>
|
||||
<a name="//apple_ref/swift/Protocol/WebAppContaining" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:P4HTTP16WebAppContaining">WebAppContaining</a>
|
||||
<a name="/s:4HTTP10HTTPServerC"></a>
|
||||
<a name="//apple_ref/swift/Class/HTTPServer" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPServerC">HTTPServer</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -147,35 +153,17 @@
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Class protocol containing the WebApp that responds to the incoming HTTP requests.
|
||||
The following is an example of a WebApp that returns the request as a response:</p>
|
||||
<pre class="highlight swift"><code> <span class="kd">class</span> <span class="kt">EchoWebApp</span><span class="p">:</span> <span class="kt">WebAppContaining</span> <span class="p">{</span>
|
||||
<span class="kd">func</span> <span class="nf">serve</span><span class="p">(</span><span class="nv">req</span><span class="p">:</span> <span class="kt">HTTPRequest</span><span class="p">,</span> <span class="nv">res</span><span class="p">:</span> <span class="kt">HTTPResponseWriter</span> <span class="p">)</span> <span class="o">-></span> <span class="kt">HTTPBodyProcessing</span> <span class="p">{</span>
|
||||
<span class="n">res</span><span class="o">.</span><span class="nf">writeHeader</span><span class="p">(</span><span class="nv">status</span><span class="p">:</span> <span class="o">.</span><span class="n">ok</span><span class="p">,</span> <span class="nv">headers</span><span class="p">:</span> <span class="p">[:])</span>
|
||||
<span class="k">return</span> <span class="o">.</span><span class="n">processBody</span> <span class="p">{</span> <span class="p">(</span><span class="n">chunk</span><span class="p">,</span> <span class="n">stop</span><span class="p">)</span> <span class="k">in</span>
|
||||
<span class="k">switch</span> <span class="n">chunk</span> <span class="p">{</span>
|
||||
<span class="k">case</span> <span class="o">.</span><span class="nf">chunk</span><span class="p">(</span><span class="k">let</span> <span class="nv">data</span><span class="p">,</span> <span class="k">let</span> <span class="nv">finishedProcessing</span><span class="p">):</span>
|
||||
<span class="n">res</span><span class="o">.</span><span class="nf">writeBody</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="p">{</span> <span class="n">_</span> <span class="k">in</span>
|
||||
<span class="nf">finishedProcessing</span><span class="p">()</span>
|
||||
<span class="p">}</span>
|
||||
<span class="k">case</span> <span class="o">.</span><span class="nv">end</span><span class="p">:</span>
|
||||
<span class="n">res</span><span class="o">.</span><span class="nf">done</span><span class="p">()</span>
|
||||
<span class="k">default</span><span class="p">:</span>
|
||||
<span class="n">stop</span> <span class="o">=</span> <span class="kc">true</span>
|
||||
<span class="n">res</span><span class="o">.</span><span class="nf">abort</span><span class="p">()</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
<p>A basic HTTP server. Currently this is implemented using the PoCSocket
|
||||
abstraction, but the intention is to remove this dependency and reimplement
|
||||
the class using transport APIs provided by the Server APIs working group.</p>
|
||||
|
||||
<a href="Protocols/WebAppContaining.html" class="slightly-smaller">See more</a>
|
||||
<a href="Classes/HTTPServer.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">WebAppContaining</span><span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">HTTPServer</span><span class="p">:</span> <span class="kt"><a href="Protocols/HTTPServing.html">HTTPServing</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -185,9 +173,9 @@ The following is an example of a WebApp that returns the request as a response:<
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP6WebApp"></a>
|
||||
<a name="//apple_ref/swift/Alias/WebApp" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a name="/s:4HTTP11HTTPServingP"></a>
|
||||
<a name="//apple_ref/swift/Protocol/HTTPServing" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPServingP">HTTPServing</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -195,14 +183,66 @@ The following is an example of a WebApp that returns the request as a response:<
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Typealias for a closure that handles an incoming HTTP request</p>
|
||||
<p>Definition of an HTTP server.</p>
|
||||
|
||||
<a href="Protocols/HTTPServing.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">HTTPServing</span> <span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP18HTTPRequestHandlera"></a>
|
||||
<a name="//apple_ref/swift/Alias/HTTPRequestHandler" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Typealias for a closure that handles an incoming HTTP request
|
||||
The following is an example of an echo <code>HTTPRequestHandler</code> that returns the request it receives as a response:</p>
|
||||
<pre class="highlight swift"><code> <span class="kd">func</span> <span class="nf">echo</span><span class="p">(</span><span class="nv">request</span><span class="p">:</span> <span class="kt">HTTPRequest</span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt">HTTPResponseWriter</span> <span class="p">)</span> <span class="o">-></span> <span class="kt">HTTPBodyProcessing</span> <span class="p">{</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">writeHeader</span><span class="p">(</span><span class="nv">status</span><span class="p">:</span> <span class="o">.</span><span class="n">ok</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="o">.</span><span class="n">processBody</span> <span class="p">{</span> <span class="p">(</span><span class="n">chunk</span><span class="p">,</span> <span class="n">stop</span><span class="p">)</span> <span class="k">in</span>
|
||||
<span class="k">switch</span> <span class="n">chunk</span> <span class="p">{</span>
|
||||
<span class="k">case</span> <span class="o">.</span><span class="nf">chunk</span><span class="p">(</span><span class="k">let</span> <span class="nv">data</span><span class="p">,</span> <span class="k">let</span> <span class="nv">finishedProcessing</span><span class="p">):</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">writeBody</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="p">{</span> <span class="n">_</span> <span class="k">in</span>
|
||||
<span class="nf">finishedProcessing</span><span class="p">()</span>
|
||||
<span class="p">}</span>
|
||||
<span class="k">case</span> <span class="o">.</span><span class="nv">end</span><span class="p">:</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">done</span><span class="p">()</span>
|
||||
<span class="k">default</span><span class="p">:</span>
|
||||
<span class="n">stop</span> <span class="o">=</span> <span class="kc">true</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">abort</span><span class="p">()</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
|
||||
<p>This then needs to be registered with the server using <code><a href="Classes/HTTPServer.html#/s:4HTTP10HTTPServerC5startySi4port_AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF">HTTPServer.start(port:handler:)</a></code></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">WebApp</span> <span class="o">=</span> <span class="p">(</span><span class="kt"><a href="Structs/HTTPRequest.html">HTTPRequest</a></span><span class="p">,</span> <span class="kt"><a href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a></span><span class="p">)</span> <span class="o">-></span> <span class="kt"><a href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a></span></code></pre>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">HTTPRequestHandler</span> <span class="o">=</span> <span class="p">(</span><span class="kt"><a href="Structs/HTTPRequest.html">HTTPRequest</a></span><span class="p">,</span> <span class="kt"><a href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a></span><span class="p">)</span> <span class="o">-></span> <span class="kt"><a href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -240,6 +280,39 @@ The following is an example of a WebApp that returns the request as a response:<
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP19HTTPRequestHandlingP"></a>
|
||||
<a name="//apple_ref/swift/Protocol/HTTPRequestHandling" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP19HTTPRequestHandlingP">HTTPRequestHandling</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Class protocol containing a <code>handle()</code> function that implements <code><a href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></code> to respond to incoming HTTP requests.</p>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></code> for more information
|
||||
|
||||
</div>
|
||||
|
||||
<a href="Protocols/HTTPRequestHandling.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">HTTPRequestHandling</span><span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -248,7 +321,7 @@ The following is an example of a WebApp that returns the request as a response:<
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -1,211 +0,0 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
|
||||
## Runtime Library Exception to the Apache 2.0 License: ##
|
||||
|
||||
|
||||
As an exception, if you use this Software to compile your source code and
|
||||
portions of this Software are embedded into the binary product as a result,
|
||||
you may redistribute such product without providing attribution as would
|
||||
otherwise be required by Sections 4(a), 4(b) and 4(d) of the License.
|
||||
@@ -0,0 +1,274 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Other Classes Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<a title="Other Classes Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(99% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="index.html">HTTP Reference</a>
|
||||
<img class="carat" src="img/carat.png" />
|
||||
Other Classes Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Classes.html">Other Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/BlueSocketConnectionListener.html">BlueSocketConnectionListener</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/BlueSocketSimpleServer.html">BlueSocketSimpleServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Extensions.html">Other Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Extensions/UnsafeRawBufferPointer.html">UnsafeRawBufferPointer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Protocols.html">Other Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>Other Classes</h1>
|
||||
<p>The following classes are available globally.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP10HTTPServerC"></a>
|
||||
<a name="//apple_ref/swift/Class/HTTPServer" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPServerC">HTTPServer</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A basic HTTP server. Currently this is implemented using the BlueSocket
|
||||
abstraction, but the intention is to remove this dependency and reimplement
|
||||
the class using transport APIs provided by the Server APIs working group.</p>
|
||||
|
||||
<a href="Classes/HTTPServer.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">HTTPServer</span> <span class="p">:</span> <span class="kt"><a href="Protocols/HTTPServing.html">HTTPServing</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC"></a>
|
||||
<a name="//apple_ref/swift/Class/BlueSocketConnectionListener" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC">BlueSocketConnectionListener</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The Interface between the StreamingParser class and IBM’s BlueSocket wrapper around socket(2).
|
||||
You hopefully should be able to replace this with any network library/engine.</p>
|
||||
|
||||
<a href="Classes/BlueSocketConnectionListener.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">BlueSocketConnectionListener</span><span class="p">:</span> <span class="kt">ParserConnecting</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/Server"></a>
|
||||
<a name="//apple_ref/swift/Section/Server" class="dashAnchor"></a>
|
||||
<a href="#/Server">
|
||||
<h3 class="section-name">Server</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP22BlueSocketSimpleServerC"></a>
|
||||
<a name="//apple_ref/swift/Class/BlueSocketSimpleServer" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP22BlueSocketSimpleServerC">BlueSocketSimpleServer</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An HTTP server that listens for connections on a TCP socket and spawns Listeners to handle them.</p>
|
||||
|
||||
<a href="Classes/BlueSocketSimpleServer.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">BlueSocketSimpleServer</span> <span class="p">:</span> <span class="kt">CurrentConnectionCounting</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-08-23)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -32,7 +32,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -53,10 +53,16 @@
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -84,7 +90,7 @@
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -138,9 +144,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:O4HTTP6Result"></a>
|
||||
<a name="/s:4HTTP6ResultO"></a>
|
||||
<a name="//apple_ref/swift/Enum/Result" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:O4HTTP6Result">Result</a>
|
||||
<a class="token" href="#/s:4HTTP6ResultO">Result</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -171,7 +177,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -0,0 +1,199 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Other Extensions Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<a title="Other Extensions Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(99% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="index.html">HTTP Reference</a>
|
||||
<img class="carat" src="img/carat.png" />
|
||||
Other Extensions Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Classes.html">Other Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/BlueSocketConnectionListener.html">BlueSocketConnectionListener</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/BlueSocketSimpleServer.html">BlueSocketSimpleServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Extensions.html">Other Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Extensions/UnsafeRawBufferPointer.html">UnsafeRawBufferPointer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Protocols.html">Other Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>Other Extensions</h1>
|
||||
<p>The following extensions are available globally.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:s22UnsafeRawBufferPointerV"></a>
|
||||
<a name="//apple_ref/swift/Extension/UnsafeRawBufferPointer" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:s22UnsafeRawBufferPointerV">UnsafeRawBufferPointer</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
|
||||
<a href="Extensions/UnsafeRawBufferPointer.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">struct</span> <span class="kt">UnsafeRawBufferPointer</span> <span class="p">:</span> <span class="kt">Collection</span><span class="p">,</span> <span class="kt">RandomAccessCollection</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-08-23)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,200 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Other Protocols Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<a title="Other Protocols Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(99% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="index.html">HTTP Reference</a>
|
||||
<img class="carat" src="img/carat.png" />
|
||||
Other Protocols Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Classes.html">Other Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/BlueSocketConnectionListener.html">BlueSocketConnectionListener</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/BlueSocketSimpleServer.html">BlueSocketSimpleServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Extensions.html">Other Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Extensions/UnsafeRawBufferPointer.html">UnsafeRawBufferPointer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Protocols.html">Other Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>Other Protocols</h1>
|
||||
<p>The following protocols are available globally.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP11HTTPServingP"></a>
|
||||
<a name="//apple_ref/swift/Protocol/HTTPServing" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPServingP">HTTPServing</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Definition of an HTTP server.</p>
|
||||
|
||||
<a href="Protocols/HTTPServing.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">HTTPServing</span> <span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-08-23)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -1,20 +0,0 @@
|
||||
// swift-tools-version:3.1
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "SwiftServerHTTP",
|
||||
targets: [
|
||||
Target(name: "HTTP"),
|
||||
Target(name: "BlueSocketHTTP", dependencies: ["HTTP"]),
|
||||
],
|
||||
dependencies: [
|
||||
.Package(url: "https://github.com/IBM-Swift/CHTTPParser.git", majorVersion: 0, minor: 4),
|
||||
.Package(url: "https://github.com/IBM-Swift/BlueSocket.git", majorVersion: 0, minor: 12),
|
||||
]
|
||||
)
|
||||
|
||||
#if os(Linux)
|
||||
package.dependencies.append(
|
||||
.Package(url: "https://github.com/IBM-Swift/BlueSignals.git", majorVersion: 0, minor: 9))
|
||||
#endif
|
||||
@@ -0,0 +1,232 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>HTTPRequestHandling Protocol Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
<script src="../js/lunr.min.js" defer></script>
|
||||
<script src="../js/typeahead.jquery.js" defer></script>
|
||||
<script src="../js/jazzy.search.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Protocol/HTTPRequestHandling" class="dashAnchor"></a>
|
||||
|
||||
<a title="HTTPRequestHandling Protocol Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="../index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(100% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col--secondary">
|
||||
<form role="search" action="../search.json">
|
||||
<input type="text" placeholder="Search documentation" data-typeahead>
|
||||
</form>
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="../index.html">HTTP Reference</a>
|
||||
<img class="carat" src="../img/carat.png" />
|
||||
HTTPRequestHandling Protocol Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>HTTPRequestHandling</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">HTTPRequestHandling</span><span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Class protocol containing a <code>handle()</code> function that implements <code><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></code> to respond to incoming HTTP requests.</p>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></code> for more information
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP19HTTPRequestHandlingP6handleAA18HTTPBodyProcessingOAA0B0V7request_AA18HTTPResponseWriter_p8responsetF"></a>
|
||||
<a name="//apple_ref/swift/Method/handle(request:response:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP19HTTPRequestHandlingP6handleAA18HTTPBodyProcessingOAA0B0V7request_AA18HTTPResponseWriter_p8responsetF">handle(request:response:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>handle: function that implements <code><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></code> and is called when a new HTTP request is received by the HTTP server.</p>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></code> for more information
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">handle</span><span class="p">(</span><span class="nv">request</span><span class="p">:</span> <span class="kt"><a href="../Structs/HTTPRequest.html">HTTPRequest</a></span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt"><a href="../Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a></span><span class="p">)</span> <span class="o">-></span> <span class="kt"><a href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>request</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>the incoming HTTP request.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>response</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>a writer providing functions to create an HTTP response to the request.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP4HTTP18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus7headersVS_11HTTPHeaders10completionFOS_6ResultT__T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterP11writeHeaderyAA0B6StatusV6status_AA11HTTPHeadersV7headersyAA6ResultOc10completiontF"></a>
|
||||
<a name="//apple_ref/swift/Method/writeHeader(status:headers:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP4HTTP18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus7headersVS_11HTTPHeaders10completionFOS_6ResultT__T_">writeHeader(status:headers:completion:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterP11writeHeaderyAA0B6StatusV6status_AA11HTTPHeadersV7headersyAA6ResultOc10completiontF">writeHeader(status:headers:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -155,7 +161,7 @@
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>writeHeader: Writer function to create the headers for an HTTP response</p>
|
||||
<p>Writer function to create the headers for an HTTP response</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -215,9 +221,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP4HTTP18HTTPResponseWriter12writeTrailerFTVS_11HTTPHeaders10completionFOS_6ResultT__T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterP12writeTraileryAA11HTTPHeadersV_yAA6ResultOc10completiontF"></a>
|
||||
<a name="//apple_ref/swift/Method/writeTrailer(_:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP4HTTP18HTTPResponseWriter12writeTrailerFTVS_11HTTPHeaders10completionFOS_6ResultT__T_">writeTrailer(_:completion:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterP12writeTraileryAA11HTTPHeadersV_yAA6ResultOc10completiontF">writeTrailer(_:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -225,7 +231,7 @@
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>writeTrailer: Writer function to write a trailer header as part of the HTTP response</p>
|
||||
<p>Writer function to write a trailer header as part of the HTTP response</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -274,9 +280,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP4HTTP18HTTPResponseWriter9writeBodyFTPS_22UnsafeHTTPResponseBody_10completionFOS_6ResultT__T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterP9writeBodyyAA06UnsafebE0_p_yAA6ResultOc10completiontF"></a>
|
||||
<a name="//apple_ref/swift/Method/writeBody(_:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP4HTTP18HTTPResponseWriter9writeBodyFTPS_22UnsafeHTTPResponseBody_10completionFOS_6ResultT__T_">writeBody(_:completion:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterP9writeBodyyAA06UnsafebE0_p_yAA6ResultOc10completiontF">writeBody(_:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -284,7 +290,7 @@ This is not currently implemented</p>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>writeBody: Writer function to write data to the body of the HTTP response</p>
|
||||
<p>Writer function to write data to the body of the HTTP response</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -332,9 +338,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP4HTTP18HTTPResponseWriter4doneFT10completionFOS_6ResultT__T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterP4doneyyAA6ResultOc10completion_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/done(completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP4HTTP18HTTPResponseWriter4doneFT10completionFOS_6ResultT__T_">done(completion:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterP4doneyyAA6ResultOc10completion_tF">done(completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -342,7 +348,7 @@ This is not currently implemented</p>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>done: Writer function to complete the HTTP response</p>
|
||||
<p>Writer function to complete the HTTP response</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -378,9 +384,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP4HTTP18HTTPResponseWriter5abortFT_T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterP5abortyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/abort()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP4HTTP18HTTPResponseWriter5abortFT_T_">abort()</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterP5abortyyF">abort()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -409,9 +415,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FE4HTTPPS_18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus7headersVS_11HTTPHeaders_T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterPAAE11writeHeaderyAA0B6StatusV6status_AA11HTTPHeadersV7headerstF"></a>
|
||||
<a name="//apple_ref/swift/Method/writeHeader(status:headers:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4HTTPPS_18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus7headersVS_11HTTPHeaders_T_">writeHeader(status:headers:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterPAAE11writeHeaderyAA0B6StatusV6status_AA11HTTPHeadersV7headerstF">writeHeader(status:headers:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Extension method
|
||||
@@ -422,10 +428,10 @@ This is not currently implemented</p>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Convenience funtion to write the headers for an HTTP response without a completion handler</p>
|
||||
<p>Convenience function to write the headers for an HTTP response without a completion handler</p>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="../Protocols/HTTPResponseWriter.html#/s:FP4HTTP18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus7headersVS_11HTTPHeaders10completionFOS_6ResultT__T_">writeHeader(status:headers:completion:)</a></code>
|
||||
<code><a href="../Protocols/HTTPResponseWriter.html#/s:4HTTP18HTTPResponseWriterP11writeHeaderyAA0B6StatusV6status_AA11HTTPHeadersV7headersyAA6ResultOc10completiontF">writeHeader(status:headers:completion:)</a></code>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -444,9 +450,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FE4HTTPPS_18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus_T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterPAAE11writeHeaderyAA0B6StatusV6status_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/writeHeader(status:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4HTTPPS_18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus_T_">writeHeader(status:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterPAAE11writeHeaderyAA0B6StatusV6status_tF">writeHeader(status:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Extension method
|
||||
@@ -457,10 +463,10 @@ This is not currently implemented</p>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Convenience funtion to write a HTTP response with no headers or completion handler</p>
|
||||
<p>Convenience function to write a HTTP response with no headers or completion handler</p>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="../Protocols/HTTPResponseWriter.html#/s:FP4HTTP18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus7headersVS_11HTTPHeaders10completionFOS_6ResultT__T_">writeHeader(status:headers:completion:)</a></code>
|
||||
<code><a href="../Protocols/HTTPResponseWriter.html#/s:4HTTP18HTTPResponseWriterP11writeHeaderyAA0B6StatusV6status_AA11HTTPHeadersV7headersyAA6ResultOc10completiontF">writeHeader(status:headers:completion:)</a></code>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -479,9 +485,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FE4HTTPPS_18HTTPResponseWriter12writeTrailerFVS_11HTTPHeadersT_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterPAAE12writeTraileryAA11HTTPHeadersVF"></a>
|
||||
<a name="//apple_ref/swift/Method/writeTrailer(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4HTTPPS_18HTTPResponseWriter12writeTrailerFVS_11HTTPHeadersT_">writeTrailer(_:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterPAAE12writeTraileryAA11HTTPHeadersVF">writeTrailer(_:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Extension method
|
||||
@@ -495,7 +501,7 @@ This is not currently implemented</p>
|
||||
<p>Convenience function to write a trailer header as part of the HTTP response without a completion handler</p>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="../Protocols/HTTPResponseWriter.html#/s:FP4HTTP18HTTPResponseWriter12writeTrailerFTVS_11HTTPHeaders10completionFOS_6ResultT__T_">writeTrailer(_:completion:)</a></code>
|
||||
<code><a href="../Protocols/HTTPResponseWriter.html#/s:4HTTP18HTTPResponseWriterP12writeTraileryAA11HTTPHeadersV_yAA6ResultOc10completiontF">writeTrailer(_:completion:)</a></code>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -514,9 +520,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FE4HTTPPS_18HTTPResponseWriter9writeBodyFPS_22UnsafeHTTPResponseBody_T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterPAAE9writeBodyyAA06UnsafebE0_pF"></a>
|
||||
<a name="//apple_ref/swift/Method/writeBody(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4HTTPPS_18HTTPResponseWriter9writeBodyFPS_22UnsafeHTTPResponseBody_T_">writeBody(_:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterPAAE9writeBodyyAA06UnsafebE0_pF">writeBody(_:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Extension method
|
||||
@@ -549,9 +555,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FE4HTTPPS_18HTTPResponseWriter4doneFT_T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterPAAE4doneyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/done()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4HTTPPS_18HTTPResponseWriter4doneFT_T_">done()</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterPAAE4doneyyF">done()</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Extension method
|
||||
@@ -589,7 +595,7 @@ This is not currently implemented</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -0,0 +1,272 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>HTTPServing Protocol Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
<script src="../js/lunr.min.js" defer></script>
|
||||
<script src="../js/typeahead.jquery.js" defer></script>
|
||||
<script src="../js/jazzy.search.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Protocol/HTTPServing" class="dashAnchor"></a>
|
||||
|
||||
<a title="HTTPServing Protocol Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="../index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(100% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col--secondary">
|
||||
<form role="search" action="../search.json">
|
||||
<input type="text" placeholder="Search documentation" data-typeahead>
|
||||
</form>
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="../index.html">HTTP Reference</a>
|
||||
<img class="carat" src="../img/carat.png" />
|
||||
HTTPServing Protocol Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>HTTPServing</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">HTTPServing</span> <span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Definition of an HTTP server.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP11HTTPServingP5startySi4port_AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF"></a>
|
||||
<a name="//apple_ref/swift/Method/start(port:handler:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPServingP5startySi4port_AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF">start(port:handler:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Start the HTTP server on the given <code><a href="../Protocols/HTTPServing.html#/s:4HTTP11HTTPServingP4portSiv">port</a></code>, using <code>handler</code> to process incoming requests</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">start</span><span class="p">(</span><span class="nv">port</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">handler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt"><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></span><span class="p">)</span> <span class="k">throws</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP11HTTPServingP4stopyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/stop()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPServingP4stopyyF">stop()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Stop the server</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">stop</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP11HTTPServingP4portSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/port" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPServingP4portSiv">port</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The port the server is listening on</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">var</span> <span class="nv">port</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP11HTTPServingP15connectionCountSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/connectionCount" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPServingP15connectionCountSiv">connectionCount</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The number of current connections</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">var</span> <span class="nv">connectionCount</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -1,3 +0,0 @@
|
||||
# SwiftServerHttp
|
||||
|
||||
Sample prototype implementation of @weissi's HTTP Sketch v2 from https://lists.swift.org/pipermail/swift-server-dev/Week-of-Mon-20170403/000422.html for discussion.
|
||||
@@ -1,275 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import HTTP
|
||||
|
||||
import Socket
|
||||
|
||||
#if os(Linux)
|
||||
import Signals
|
||||
import Dispatch
|
||||
#endif
|
||||
|
||||
|
||||
/// The Interface between the StreamingParser class and IBM's BlueSocket wrapper around socket(2).
|
||||
/// You hopefully should be able to replace this with any network library/engine.
|
||||
public class BlueSocketConnectionListener: ParserConnecting {
|
||||
var socket: Socket?
|
||||
|
||||
///ivar for the thing that manages the CHTTP Parser
|
||||
var parser: StreamingParser?
|
||||
|
||||
///Save the socket file descriptor so we can loook at it for debugging purposes
|
||||
var socketFD: Int32
|
||||
|
||||
/// Queues for managing access to the socket without blocking the world
|
||||
weak var socketReaderQueue: DispatchQueue?
|
||||
weak var socketWriterQueue: DispatchQueue?
|
||||
|
||||
///Event handler for reading from the socket
|
||||
private var readerSource: DispatchSourceRead?
|
||||
|
||||
///Flag to track whether we're in the middle of a response or not (with lock)
|
||||
private let _responseCompletedLock = DispatchSemaphore(value: 1)
|
||||
private var _responseCompleted: Bool = false
|
||||
var responseCompleted: Bool {
|
||||
get {
|
||||
_responseCompletedLock.wait()
|
||||
defer {
|
||||
_responseCompletedLock.signal()
|
||||
}
|
||||
return _responseCompleted
|
||||
}
|
||||
set {
|
||||
_responseCompletedLock.wait()
|
||||
defer {
|
||||
_responseCompletedLock.signal()
|
||||
}
|
||||
_responseCompleted = newValue
|
||||
}
|
||||
}
|
||||
|
||||
///Flag to track whether we've received a socket error or not (with lock)
|
||||
private let _errorOccurredLock = DispatchSemaphore(value: 1)
|
||||
private var _errorOccurred: Bool = false
|
||||
var errorOccurred: Bool {
|
||||
get {
|
||||
_errorOccurredLock.wait()
|
||||
defer {
|
||||
_errorOccurredLock.signal()
|
||||
}
|
||||
return _errorOccurred
|
||||
}
|
||||
set {
|
||||
_errorOccurredLock.wait()
|
||||
defer {
|
||||
_errorOccurredLock.signal()
|
||||
}
|
||||
_errorOccurred = newValue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// initializer
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - socket: Socket object from BlueSocket library wrapping a socket(2)
|
||||
/// - parser: Manager of the CHTTPParser library
|
||||
public init(socket: Socket, parser: StreamingParser, readQueue: DispatchQueue, writeQueue: DispatchQueue) {
|
||||
self.socket = socket
|
||||
socketFD = socket.socketfd
|
||||
socketReaderQueue = readQueue
|
||||
socketWriterQueue = writeQueue
|
||||
self.parser = parser
|
||||
parser.parserConnector = self
|
||||
}
|
||||
|
||||
|
||||
/// Check if socket is still open. Used to decide whether it should be closed/pruned after timeout
|
||||
public var isOpen: Bool {
|
||||
guard let socket = self.socket else {
|
||||
return false
|
||||
}
|
||||
return (socket.isActive || socket.isConnected)
|
||||
}
|
||||
|
||||
|
||||
/// Close the socket and free up memory unless we're in the middle of a request
|
||||
func close() {
|
||||
if !self.responseCompleted && !self.errorOccurred {
|
||||
return
|
||||
}
|
||||
if (self.socket?.socketfd ?? -1) > 0 {
|
||||
self.socket?.close()
|
||||
}
|
||||
|
||||
//In a perfect world, we wouldn't have to clean this all up explicitly,
|
||||
// but KDE/heaptrack informs us we're in far from a perfect world
|
||||
|
||||
if !(self.readerSource?.isCancelled ?? true) {
|
||||
self.readerSource?.cancel()
|
||||
}
|
||||
self.readerSource?.setEventHandler(handler: nil)
|
||||
self.readerSource?.setCancelHandler(handler: nil)
|
||||
|
||||
self.readerSource = nil
|
||||
self.socket = nil
|
||||
self.parser?.parserConnector = nil //allows for memory to be reclaimed
|
||||
self.parser = nil
|
||||
self.socketReaderQueue = nil
|
||||
self.socketWriterQueue = nil
|
||||
}
|
||||
|
||||
|
||||
/// Called by the parser to let us know that it's done with this socket
|
||||
public func closeWriter() {
|
||||
self.socketWriterQueue?.async { [weak self] in
|
||||
if (self?.readerSource?.isCancelled ?? true) {
|
||||
self?.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Check if the socket is idle, and if so, call close()
|
||||
func closeIfIdleSocket() {
|
||||
let now = Date().timeIntervalSinceReferenceDate
|
||||
if let keepAliveUntil = parser?.keepAliveUntil, now >= keepAliveUntil {
|
||||
print("Closing idle socket \(socketFD)")
|
||||
close()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Called by the parser to let us know that a response has started being created
|
||||
public func responseBeginning() {
|
||||
self.socketWriterQueue?.async { [weak self] in
|
||||
self?.responseCompleted = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Called by the parser to let us know that a response is complete, and we can close after timeout
|
||||
public func responseComplete() {
|
||||
self.socketWriterQueue?.async { [weak self] in
|
||||
self?.responseCompleted = true
|
||||
if (self?.readerSource?.isCancelled ?? true) {
|
||||
self?.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Starts reading from the socket and feeding that data to the parser
|
||||
public func process() {
|
||||
do {
|
||||
try! socket?.setBlocking(mode: true)
|
||||
|
||||
let tempReaderSource = DispatchSource.makeReadSource(fileDescriptor: socket?.socketfd ?? -1,
|
||||
queue: socketReaderQueue)
|
||||
|
||||
tempReaderSource.setEventHandler { [weak self] in
|
||||
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
guard strongSelf.socket?.socketfd ?? -1 > 0 else {
|
||||
self?.readerSource?.cancel()
|
||||
return
|
||||
}
|
||||
|
||||
var length = 1 //initial value
|
||||
do {
|
||||
repeat {
|
||||
if strongSelf.socket?.socketfd ?? -1 > 0 {
|
||||
let readBuffer:NSMutableData = NSMutableData()
|
||||
length = try strongSelf.socket?.read(into: readBuffer) ?? -1
|
||||
if length > 0 {
|
||||
self?.responseCompleted = false
|
||||
}
|
||||
let data = Data(bytes:readBuffer.bytes.assumingMemoryBound(to: Int8.self), count:readBuffer.length)
|
||||
|
||||
let numberParsed = strongSelf.parser?.readStream(data:data) ?? 0
|
||||
|
||||
if numberParsed != data.count {
|
||||
print("Error: wrong number of bytes consumed by parser (\(numberParsed) instead of \(data.count)")
|
||||
}
|
||||
} else {
|
||||
print("bad socket FD while reading")
|
||||
length = -1
|
||||
}
|
||||
|
||||
} while length > 0
|
||||
} catch {
|
||||
print("ReaderSource Event Error: \(error)")
|
||||
self?.readerSource?.cancel()
|
||||
self?.errorOccurred = true
|
||||
self?.close()
|
||||
}
|
||||
if (length == 0) {
|
||||
self?.readerSource?.cancel()
|
||||
}
|
||||
if (length < 0) {
|
||||
self?.errorOccurred = true
|
||||
self?.readerSource?.cancel()
|
||||
self?.close()
|
||||
}
|
||||
}
|
||||
|
||||
tempReaderSource.setCancelHandler { [ weak self] in
|
||||
self?.close() //close if we can
|
||||
}
|
||||
|
||||
self.readerSource = tempReaderSource
|
||||
self.readerSource?.resume()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Called by the parser to give us data to send back out of the socket
|
||||
///
|
||||
/// - Parameter bytes: Data object to be queued to be written to the socket
|
||||
public func queueSocketWrite(_ bytes: Data) {
|
||||
self.socketWriterQueue?.async { [ weak self ] in
|
||||
self?.write(bytes)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Write data to a socket. Should be called in an `async` block on the `socketWriterQueue`
|
||||
///
|
||||
/// - Parameter data: data to be written
|
||||
public func write(_ data:Data) {
|
||||
do {
|
||||
var written: Int = 0
|
||||
var offset = 0
|
||||
|
||||
while written < data.count && !errorOccurred {
|
||||
try data.withUnsafeBytes { (ptr: UnsafePointer<UInt8>) in
|
||||
let result = try socket?.write(from: ptr + offset, bufSize:
|
||||
data.count - offset) ?? -1
|
||||
if (result < 0) {
|
||||
print("Recived broken write socket indication")
|
||||
errorOccurred = true
|
||||
} else {
|
||||
written += result
|
||||
}
|
||||
}
|
||||
offset = data.count - written
|
||||
}
|
||||
if (errorOccurred) {
|
||||
close()
|
||||
return
|
||||
}
|
||||
} catch {
|
||||
print("Recived write socket error: \(error)")
|
||||
errorOccurred = true
|
||||
close()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,186 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import HTTP
|
||||
|
||||
import Socket
|
||||
|
||||
//import HeliumLogger
|
||||
|
||||
#if os(Linux)
|
||||
import Signals
|
||||
#endif
|
||||
|
||||
|
||||
// MARK: Server
|
||||
|
||||
/// An HTTP server that listens for connections on a TCP socket and spawns Listeners to handle them.
|
||||
public class BlueSocketSimpleServer : CurrentConnectionCounting {
|
||||
|
||||
|
||||
/// Socket to listen on for connections
|
||||
private let serverSocket: Socket
|
||||
|
||||
/// Collection of listeners of sockets. Used to kill connections on timeout or shutdown
|
||||
private var connectionListenerList = ConnectionListenerCollection()
|
||||
|
||||
// Timer that cleans up idle sockets on expire
|
||||
private let pruneSocketTimer: DispatchSourceTimer
|
||||
|
||||
/// The port we're listening on. Used primarily to query a randomly assigned port during XCTests
|
||||
public var port: Int {
|
||||
return Int(serverSocket.listeningPort)
|
||||
}
|
||||
|
||||
/// Tuning parameter to set the number of queues
|
||||
private var queueMax: Int
|
||||
|
||||
/// Tuning parameter to set the number of sockets we can accept at one time
|
||||
private var acceptMax: Int
|
||||
|
||||
public init() {
|
||||
#if os(Linux)
|
||||
Signals.trap(signal: .pipe) {
|
||||
_ in
|
||||
print("Receiver closed socket, SIGPIPE ignored")
|
||||
}
|
||||
#endif
|
||||
|
||||
serverSocket = try! Socket.create()
|
||||
pruneSocketTimer = DispatchSource.makeTimerSource(queue: DispatchQueue(label: "pruneSocketTimer"))
|
||||
queueMax = 4 //sensible default
|
||||
acceptMax = 8 //sensible default
|
||||
}
|
||||
|
||||
|
||||
/// Starts the server listening on a given port
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - port: TCP port. See listen(2)
|
||||
/// - webapp: Function that creates the HTTP Response from the HTTP Request
|
||||
/// - Throws: Error (usually a socket error) generated
|
||||
public func start(port: Int = 0, queueCount: Int = 0, acceptCount: Int = 0, webapp: @escaping WebApp) throws {
|
||||
if queueCount > 0 {
|
||||
queueMax = queueCount
|
||||
}
|
||||
if acceptCount > 0 {
|
||||
acceptMax = acceptCount
|
||||
}
|
||||
try self.serverSocket.listen(on: port, maxBacklogSize: 100)
|
||||
|
||||
pruneSocketTimer.setEventHandler { [weak self] in
|
||||
self?.connectionListenerList.prune()
|
||||
}
|
||||
pruneSocketTimer.scheduleRepeating(deadline: .now() + StreamingParser.keepAliveTimeout, interval: .seconds(Int(StreamingParser.keepAliveTimeout)))
|
||||
pruneSocketTimer.resume()
|
||||
|
||||
var readQueues = [DispatchQueue]()
|
||||
var writeQueues = [DispatchQueue]()
|
||||
let acceptQueue = DispatchQueue(label: "Accept Queue", qos: .default, attributes: .concurrent)
|
||||
|
||||
let acceptSemaphore = DispatchSemaphore.init(value: acceptMax)
|
||||
|
||||
for i in 0..<queueMax {
|
||||
readQueues.append(DispatchQueue(label: "Read Queue \(i)"))
|
||||
writeQueues.append(DispatchQueue(label: "Write Queue \(i)"))
|
||||
}
|
||||
|
||||
print ("Started server on port \(self.serverSocket.listeningPort) with \(self.queueMax) Serial Queues of each type and \(self.acceptMax) accept sockets")
|
||||
|
||||
var listenerCount = 0
|
||||
DispatchQueue.global().async {
|
||||
repeat {
|
||||
do {
|
||||
let clientSocket = try self.serverSocket.acceptClientConnection()
|
||||
let streamingParser = StreamingParser(webapp: webapp, connectionCounter: self)
|
||||
let readQueue = readQueues[listenerCount % self.queueMax]
|
||||
let writeQueue = writeQueues[listenerCount % self.queueMax]
|
||||
let listener = BlueSocketConnectionListener(socket:clientSocket, parser: streamingParser, readQueue:readQueue, writeQueue: writeQueue)
|
||||
listenerCount += 1
|
||||
acceptSemaphore.wait()
|
||||
acceptQueue.async { [weak listener] in
|
||||
listener?.process()
|
||||
acceptSemaphore.signal()
|
||||
}
|
||||
self.connectionListenerList.add(listener)
|
||||
|
||||
} catch let error {
|
||||
print("Error accepting client connection: \(error)")
|
||||
}
|
||||
} while self.serverSocket.isListening
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Stop the server and close the sockets
|
||||
public func stop() {
|
||||
connectionListenerList.closeAll()
|
||||
serverSocket.close()
|
||||
}
|
||||
|
||||
|
||||
/// Count the connections - can be used in XCTests
|
||||
public var connectionCount: Int {
|
||||
return connectionListenerList.count
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Collection of ConnectionListeners, wrapped with weak references, so the memory can be freed when the socket closes
|
||||
class ConnectionListenerCollection {
|
||||
|
||||
/// Weak wrapper class
|
||||
class WeakConnectionListener<T: AnyObject> {
|
||||
weak var value : T?
|
||||
init (_ value: T) {
|
||||
self.value = value
|
||||
}
|
||||
}
|
||||
|
||||
let lock = DispatchSemaphore(value: 1)
|
||||
|
||||
/// Storage for weak connection listeners
|
||||
var storage = [WeakConnectionListener<BlueSocketConnectionListener>]()
|
||||
|
||||
|
||||
/// Add a new connection to the collection
|
||||
///
|
||||
/// - Parameter listener: socket manager object
|
||||
func add(_ listener:BlueSocketConnectionListener) {
|
||||
lock.wait()
|
||||
storage.append(WeakConnectionListener(listener))
|
||||
lock.signal()
|
||||
}
|
||||
|
||||
/// Used when shutting down the server to close all connections
|
||||
func closeAll() {
|
||||
lock.wait()
|
||||
storage.filter { nil != $0.value }.forEach { $0.value?.close() }
|
||||
lock.signal()
|
||||
}
|
||||
|
||||
/// Close any idle sockets and remove any weak pointers to closed (and freed) sockets from the collection
|
||||
func prune() {
|
||||
lock.wait()
|
||||
storage.filter { nil != $0.value }.forEach { $0.value?.closeIfIdleSocket() }
|
||||
storage = storage.filter { nil != $0.value }.filter { $0.value?.isOpen ?? false}
|
||||
lock.signal()
|
||||
}
|
||||
|
||||
/// Count of collections
|
||||
var count: Int {
|
||||
lock.wait()
|
||||
let c = storage.filter { nil != $0.value }.count
|
||||
lock.signal()
|
||||
return c
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Typealias for a closure that handles an incoming HTTP request
|
||||
/// - Parameter req: the incoming HTTP request.
|
||||
/// - Parameter res: a writer providing functions to create an HTTP reponse to the request.
|
||||
/// - Returns HTTPBodyProcessing: a enum that either discards the request data, or provides a closure to process it.
|
||||
public typealias WebApp = (HTTPRequest, HTTPResponseWriter) -> HTTPBodyProcessing
|
||||
|
||||
/// Class protocol containing the WebApp that responds to the incoming HTTP requests.
|
||||
/// The following is an example of a WebApp that returns the request as a response:
|
||||
/// ```swift
|
||||
/// class EchoWebApp: WebAppContaining {
|
||||
/// func serve(req: HTTPRequest, res: HTTPResponseWriter ) -> HTTPBodyProcessing {
|
||||
/// res.writeHeader(status: .ok, headers: [:])
|
||||
/// return .processBody { (chunk, stop) in
|
||||
/// switch chunk {
|
||||
/// case .chunk(let data, let finishedProcessing):
|
||||
/// res.writeBody(data) { _ in
|
||||
/// finishedProcessing()
|
||||
/// }
|
||||
/// case .end:
|
||||
/// res.done()
|
||||
/// default:
|
||||
/// stop = true
|
||||
/// res.abort()
|
||||
/// }
|
||||
/// }
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
public protocol WebAppContaining: class {
|
||||
/// serve: function called when a new HTTP request is received by the HTTP server.
|
||||
/// - Parameter req: the incoming HTTP request.
|
||||
/// - Parameter res: an writer providing functions to create an HTTP reponse to the request.
|
||||
/// - Returns HTTPBodyProcessing: a enum that either discards the request data, or provides a closure to process it.
|
||||
func serve(req: HTTPRequest, res: HTTPResponseWriter ) -> HTTPBodyProcessing
|
||||
}
|
||||
|
||||
/// The result returned as part of a completion handler
|
||||
public enum Result {
|
||||
/// The action was successful
|
||||
case ok
|
||||
/// An error occurred during the processing of the action
|
||||
case error(Error)
|
||||
}
|
||||
@@ -1,544 +0,0 @@
|
||||
/// Representation of the HTTP headers associated with a `HTTPRequest` or `HTTPResponse`.
|
||||
/// Headers are subscriptable using case-insensitive comparison or provide `Name` constants. eg.
|
||||
/// ```swift
|
||||
/// let contentLength = headers["content-length"]
|
||||
/// ```
|
||||
/// or
|
||||
/// ```swift
|
||||
/// let contentLength = headers[.contentLength]
|
||||
/// ```
|
||||
public struct HTTPHeaders {
|
||||
var original: [(name: Name, value: String)]?
|
||||
var storage: [Name: [String]] {
|
||||
didSet { original = nil }
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public subscript(name: Name) -> String? {
|
||||
get {
|
||||
guard let value = storage[name] else { return nil }
|
||||
switch name {
|
||||
case Name.setCookie: // Exception, see note in [RFC7230, section 3.2.2]
|
||||
return value.isEmpty ? nil : value[0]
|
||||
default:
|
||||
return value.joined(separator: ",")
|
||||
}
|
||||
}
|
||||
set {
|
||||
storage[name] = newValue.map { [$0] }
|
||||
}
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public subscript(valuesFor name: Name) -> [String] {
|
||||
get { return storage[name] ?? [] }
|
||||
set { storage[name] = newValue.isEmpty ? nil : newValue }
|
||||
}
|
||||
}
|
||||
|
||||
extension HTTPHeaders : ExpressibleByDictionaryLiteral {
|
||||
/// Creates HTTP headers.
|
||||
public init(dictionaryLiteral: (Name, String)...) {
|
||||
storage = [:]
|
||||
for (name, value) in dictionaryLiteral {
|
||||
#if swift(>=4.0)
|
||||
storage[name, default: []].append(value)
|
||||
#else
|
||||
if storage[name] == nil {
|
||||
storage[name] = [value]
|
||||
} else {
|
||||
storage[name]!.append(value)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
original = dictionaryLiteral
|
||||
}
|
||||
}
|
||||
|
||||
extension HTTPHeaders {
|
||||
// Used instead of HTTPHeaders to save CPU on dictionary construction
|
||||
/// :nodoc:
|
||||
public struct Literal : ExpressibleByDictionaryLiteral {
|
||||
let fields: [(name: Name, value: String)]
|
||||
|
||||
public init(dictionaryLiteral: (Name, String)...) {
|
||||
fields = dictionaryLiteral
|
||||
}
|
||||
}
|
||||
|
||||
/// Appends a header to the headers
|
||||
public mutating func append(_ literal: HTTPHeaders.Literal) {
|
||||
for (name, value) in literal.fields {
|
||||
#if swift(>=4.0)
|
||||
storage[name, default: []].append(value)
|
||||
#else
|
||||
if storage[name] == nil {
|
||||
storage[name] = [value]
|
||||
} else {
|
||||
storage[name]!.append(value)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// Replaces a header in the headers
|
||||
public mutating func replace(_ literal: HTTPHeaders.Literal) {
|
||||
for (name, _) in literal.fields {
|
||||
storage[name] = []
|
||||
}
|
||||
for (name, value) in literal.fields {
|
||||
storage[name]!.append(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension HTTPHeaders : Sequence {
|
||||
/// :nodoc:
|
||||
public func makeIterator() -> AnyIterator<(name: Name, value: String)> {
|
||||
if let original = original {
|
||||
return AnyIterator(original.makeIterator())
|
||||
} else {
|
||||
return AnyIterator(StorageIterator(storage.makeIterator()))
|
||||
}
|
||||
}
|
||||
|
||||
struct StorageIterator : IteratorProtocol {
|
||||
var headers: DictionaryIterator<Name, [String]>
|
||||
var header: (name: Name, values: IndexingIterator<[String]>)?
|
||||
|
||||
init(_ iterator: DictionaryIterator<Name, [String]>) {
|
||||
headers = iterator
|
||||
header = headers.next().map { (name: $0.key, values: $0.value.makeIterator()) }
|
||||
}
|
||||
|
||||
mutating func next() -> (name: Name, value: String)? {
|
||||
while header != nil {
|
||||
if let value = header!.values.next() {
|
||||
return (name: header!.name, value: value)
|
||||
} else {
|
||||
header = headers.next().map { (name: $0.key, values: $0.value.makeIterator()) }
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// HTTPHeaders structure.
|
||||
extension HTTPHeaders {
|
||||
|
||||
/// Type used for the name of a HTTP header in the `HTTPHeaders` storage.
|
||||
public struct Name : Hashable, ExpressibleByStringLiteral, CustomStringConvertible {
|
||||
let original: String
|
||||
let lowercased: String
|
||||
public let hashValue: Int
|
||||
|
||||
/// Create a HTTP header name with the provided String.
|
||||
public init(_ name: String) {
|
||||
original = name
|
||||
lowercased = name.lowercased()
|
||||
hashValue = lowercased.hashValue
|
||||
}
|
||||
|
||||
public init(stringLiteral: String) {
|
||||
self.init(stringLiteral)
|
||||
}
|
||||
|
||||
public init(unicodeScalarLiteral: String) {
|
||||
self.init(unicodeScalarLiteral)
|
||||
}
|
||||
|
||||
public init(extendedGraphemeClusterLiteral: String) {
|
||||
self.init(extendedGraphemeClusterLiteral)
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public var description: String {
|
||||
return original
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public static func == (lhs: Name, rhs: Name) -> Bool {
|
||||
return lhs.lowercased == rhs.lowercased
|
||||
}
|
||||
|
||||
// https://www.iana.org/assignments/message-headers/message-headers.xhtml
|
||||
// Permanent Message Header Field Names
|
||||
|
||||
/// A-IM header.
|
||||
public static let aIM = Name("A-IM")
|
||||
/// Accept header.
|
||||
public static let accept = Name("Accept")
|
||||
/// Accept-Additions header.
|
||||
public static let acceptAdditions = Name("Accept-Additions")
|
||||
/// Accept-Charset header.
|
||||
public static let acceptCharset = Name("Accept-Charset")
|
||||
/// Accept-Datetime header.
|
||||
public static let acceptDatetime = Name("Accept-Datetime")
|
||||
/// Accept-Encoding header.
|
||||
public static let acceptEncoding = Name("Accept-Encoding")
|
||||
/// Accept-Features header.
|
||||
public static let acceptFeatures = Name("Accept-Features")
|
||||
/// Accept-Language header.
|
||||
public static let acceptLanguage = Name("Accept-Language")
|
||||
/// Accept-Patch header.
|
||||
public static let acceptPatch = Name("Accept-Patch")
|
||||
/// Accept-Post header.
|
||||
public static let acceptPost = Name("Accept-Post")
|
||||
/// Accept-Ranges header.
|
||||
public static let acceptRanges = Name("Accept-Ranges")
|
||||
/// Accept-Age header.
|
||||
public static let age = Name("Age")
|
||||
/// Accept-Allow header.
|
||||
public static let allow = Name("Allow")
|
||||
/// ALPN header.
|
||||
public static let alpn = Name("ALPN")
|
||||
/// Alt-Svc header.
|
||||
public static let altSvc = Name("Alt-Svc")
|
||||
/// Alt-Used header.
|
||||
public static let altUsed = Name("Alt-Used")
|
||||
/// Alternatives header.
|
||||
public static let alternates = Name("Alternates")
|
||||
/// Apply-To-Redirect-Ref header.
|
||||
public static let applyToRedirectRef = Name("Apply-To-Redirect-Ref")
|
||||
/// Authentication-Control header.
|
||||
public static let authenticationControl = Name("Authentication-Control")
|
||||
/// Authentication-Info header.
|
||||
public static let authenticationInfo = Name("Authentication-Info")
|
||||
/// Authorization header.
|
||||
public static let authorization = Name("Authorization")
|
||||
/// C-Ext header.
|
||||
public static let cExt = Name("C-Ext")
|
||||
/// C-Man header.
|
||||
public static let cMan = Name("C-Man")
|
||||
/// C-Opt header.
|
||||
public static let cOpt = Name("C-Opt")
|
||||
/// C-PEP header.
|
||||
public static let cPEP = Name("C-PEP")
|
||||
/// C-PEP-Indo header.
|
||||
public static let cPEPInfo = Name("C-PEP-Info")
|
||||
/// Cache-Control header.
|
||||
public static let cacheControl = Name("Cache-Control")
|
||||
/// CalDav-Timezones header.
|
||||
public static let calDAVTimezones = Name("CalDAV-Timezones")
|
||||
/// Close header.
|
||||
public static let close = Name("Close")
|
||||
/// Connection header.
|
||||
public static let connection = Name("Connection")
|
||||
/// Content-Base.
|
||||
public static let contentBase = Name("Content-Base")
|
||||
/// Content-Disposition header.
|
||||
public static let contentDisposition = Name("Content-Disposition")
|
||||
/// Content-Encoding header.
|
||||
public static let contentEncoding = Name("Content-Encoding")
|
||||
/// Content-ID header.
|
||||
public static let contentID = Name("Content-ID")
|
||||
/// Content-Language header.
|
||||
public static let contentLanguage = Name("Content-Language")
|
||||
/// Content-Length header.
|
||||
public static let contentLength = Name("Content-Length")
|
||||
/// Content-Location header.
|
||||
public static let contentLocation = Name("Content-Location")
|
||||
/// Content-MD5 header.
|
||||
public static let contentMD5 = Name("Content-MD5")
|
||||
/// Content-Range header.
|
||||
public static let contentRange = Name("Content-Range")
|
||||
/// Content-Script-Type header.
|
||||
public static let contentScriptType = Name("Content-Script-Type")
|
||||
/// Content-Style-Type header.
|
||||
public static let contentStyleType = Name("Content-Style-Type")
|
||||
/// Content-Type header.
|
||||
public static let contentType = Name("Content-Type")
|
||||
/// Content-Version header.
|
||||
public static let contentVersion = Name("Content-Version")
|
||||
/// Content-Cookie header.
|
||||
public static let cookie = Name("Cookie")
|
||||
/// Content-Cookie2 header.
|
||||
public static let cookie2 = Name("Cookie2")
|
||||
/// DASL header.
|
||||
public static let dasl = Name("DASL")
|
||||
/// DASV header.
|
||||
public static let dav = Name("DAV")
|
||||
/// Date header.
|
||||
public static let date = Name("Date")
|
||||
/// Default-Style header.
|
||||
public static let defaultStyle = Name("Default-Style")
|
||||
/// Delta-Base header.
|
||||
public static let deltaBase = Name("Delta-Base")
|
||||
/// Depth header.
|
||||
public static let depth = Name("Depth")
|
||||
/// Derived-From header.
|
||||
public static let derivedFrom = Name("Derived-From")
|
||||
/// Destination header.
|
||||
public static let destination = Name("Destination")
|
||||
/// Differential-ID header.
|
||||
public static let differentialID = Name("Differential-ID")
|
||||
/// Digest header.
|
||||
public static let digest = Name("Digest")
|
||||
/// ETag header.
|
||||
public static let eTag = Name("ETag")
|
||||
/// Expect header.
|
||||
public static let expect = Name("Expect")
|
||||
/// Expires header.
|
||||
public static let expires = Name("Expires")
|
||||
/// Ext header.
|
||||
public static let ext = Name("Ext")
|
||||
/// Forwarded header.
|
||||
public static let forwarded = Name("Forwarded")
|
||||
/// From header.
|
||||
public static let from = Name("From")
|
||||
/// GetProfile header.
|
||||
public static let getProfile = Name("GetProfile")
|
||||
/// Hobareg header.
|
||||
public static let hobareg = Name("Hobareg")
|
||||
/// Host header.
|
||||
public static let host = Name("Host")
|
||||
/// HTTP2-Settings header.
|
||||
public static let http2Settings = Name("HTTP2-Settings")
|
||||
/// IM header.
|
||||
public static let im = Name("IM")
|
||||
/// If header.
|
||||
public static let `if` = Name("If")
|
||||
/// If-Match header.
|
||||
public static let ifMatch = Name("If-Match")
|
||||
/// If-Modified-Since header.
|
||||
public static let ifModifiedSince = Name("If-Modified-Since")
|
||||
/// If-None-Match header.
|
||||
public static let ifNoneMatch = Name("If-None-Match")
|
||||
/// If-Range header.
|
||||
public static let ifRange = Name("If-Range")
|
||||
/// If-Schedule-Tag-Match header.
|
||||
public static let ifScheduleTagMatch = Name("If-Schedule-Tag-Match")
|
||||
/// If-Unmodified-Since header.
|
||||
public static let ifUnmodifiedSince = Name("If-Unmodified-Since")
|
||||
/// Keep-Alive header.
|
||||
public static let keepAlive = Name("Keep-Alive")
|
||||
/// Label header.
|
||||
public static let label = Name("Label")
|
||||
/// Last-Modified header.
|
||||
public static let lastModified = Name("Last-Modified")
|
||||
/// Link header.
|
||||
public static let link = Name("Link")
|
||||
/// Location header.
|
||||
public static let location = Name("Location")
|
||||
/// Lock-Token header.
|
||||
public static let lockToken = Name("Lock-Token")
|
||||
/// Man header.
|
||||
public static let man = Name("Man")
|
||||
/// Max-Forwards header.
|
||||
public static let maxForwards = Name("Max-Forwards")
|
||||
/// Memento-Date header.
|
||||
public static let mementoDatetime = Name("Memento-Datetime")
|
||||
/// Meter header.
|
||||
public static let meter = Name("Meter")
|
||||
/// MIME-Version header.
|
||||
public static let mimeVersion = Name("MIME-Version")
|
||||
/// Negotiate header.
|
||||
public static let negotiate = Name("Negotiate")
|
||||
/// Opt header.
|
||||
public static let opt = Name("Opt")
|
||||
/// Optional-WWW-Authenticate header.
|
||||
public static let optionalWWWAuthenticate = Name("Optional-WWW-Authenticate")
|
||||
/// Ordering-Type header.
|
||||
public static let orderingType = Name("Ordering-Type")
|
||||
/// Origin header.
|
||||
public static let origin = Name("Origin")
|
||||
/// Overwrite header.
|
||||
public static let overwrite = Name("Overwrite")
|
||||
/// P3P header.
|
||||
public static let p3p = Name("P3P")
|
||||
/// PEP header.
|
||||
public static let pep = Name("PEP")
|
||||
/// PICS-Label header.
|
||||
public static let picsLabel = Name("PICS-Label")
|
||||
/// Pep-Info header.
|
||||
public static let pepInfo = Name("Pep-Info")
|
||||
/// Position header.
|
||||
public static let position = Name("Position")
|
||||
/// Pragma header.
|
||||
public static let pragma = Name("Pragma")
|
||||
/// Prefer header.
|
||||
public static let prefer = Name("Prefer")
|
||||
/// Preference-Applied header.
|
||||
public static let preferenceApplied = Name("Preference-Applied")
|
||||
/// ProfileObject header.
|
||||
public static let profileObject = Name("ProfileObject")
|
||||
/// Protocol header.
|
||||
public static let `protocol` = Name("Protocol")
|
||||
/// Protocol-Info header.
|
||||
public static let protocolInfo = Name("Protocol-Info")
|
||||
/// Protocol-Query header.
|
||||
public static let protocolQuery = Name("Protocol-Query")
|
||||
/// Protocol-Request header.
|
||||
public static let protocolRequest = Name("Protocol-Request")
|
||||
/// Proxy-Authenticate header.
|
||||
public static let proxyAuthenticate = Name("Proxy-Authenticate")
|
||||
/// Proxy-Authentication-Info header.
|
||||
public static let proxyAuthenticationInfo = Name("Proxy-Authentication-Info")
|
||||
/// Proxy-Authorization header.
|
||||
public static let proxyAuthorization = Name("Proxy-Authorization")
|
||||
/// Proxy-Features header.
|
||||
public static let proxyFeatures = Name("Proxy-Features")
|
||||
/// Proxy-Instruction header.
|
||||
public static let proxyInstruction = Name("Proxy-Instruction")
|
||||
/// Public header.
|
||||
public static let `public` = Name("Public")
|
||||
/// Public-Key-Pins header.
|
||||
public static let publicKeyPins = Name("Public-Key-Pins")
|
||||
/// Public-Key-Pins-Report-Only header.
|
||||
public static let publicKeyPinsReportOnly = Name("Public-Key-Pins-Report-Only")
|
||||
/// Range header.
|
||||
public static let range = Name("Range")
|
||||
/// Redirect-Ref header.
|
||||
public static let redirectRef = Name("Redirect-Ref")
|
||||
/// Referer header.
|
||||
public static let referer = Name("Referer")
|
||||
/// Retry-After header.
|
||||
public static let retryAfter = Name("Retry-After")
|
||||
/// Safe header.
|
||||
public static let safe = Name("Safe")
|
||||
/// Schedule-Reply header.
|
||||
public static let scheduleReply = Name("Schedule-Reply")
|
||||
/// Schedule-Tag header.
|
||||
public static let scheduleTag = Name("Schedule-Tag")
|
||||
/// Sec-WebSocket-Accept header.
|
||||
public static let secWebSocketAccept = Name("Sec-WebSocket-Accept")
|
||||
/// Sec-WebSocket-Extensions header.
|
||||
public static let secWebSocketExtensions = Name("Sec-WebSocket-Extensions")
|
||||
/// Sec-WebSocket-Key header.
|
||||
public static let secWebSocketKey = Name("Sec-WebSocket-Key")
|
||||
/// Sec-WebSocket-Protocol header.
|
||||
public static let secWebSocketProtocol = Name("Sec-WebSocket-Protocol")
|
||||
/// Sec-WebSocket-Version header.
|
||||
public static let secWebSocketVersion = Name("Sec-WebSocket-Version")
|
||||
/// Security-Scheme header.
|
||||
public static let securityScheme = Name("Security-Scheme")
|
||||
/// Server header.
|
||||
public static let server = Name("Server")
|
||||
/// Set-Cookie header.
|
||||
public static let setCookie = Name("Set-Cookie")
|
||||
/// Set-Cookie2 header.
|
||||
public static let setCookie2 = Name("Set-Cookie2")
|
||||
/// SetProfile header.
|
||||
public static let setProfile = Name("SetProfile")
|
||||
/// SLUG header.
|
||||
public static let slug = Name("SLUG")
|
||||
/// SoapAction header.
|
||||
public static let soapAction = Name("SoapAction")
|
||||
/// Status-URI header.
|
||||
public static let statusURI = Name("Status-URI")
|
||||
/// Strict-Transport-Security header.
|
||||
public static let strictTransportSecurity = Name("Strict-Transport-Security")
|
||||
/// Surrogate-Capability header.
|
||||
public static let surrogateCapability = Name("Surrogate-Capability")
|
||||
/// Surrogate-Control header.
|
||||
public static let surrogateControl = Name("Surrogate-Control")
|
||||
/// TCN header.
|
||||
public static let tcn = Name("TCN")
|
||||
/// TE header.
|
||||
public static let te = Name("TE")
|
||||
/// Timeout header.
|
||||
public static let timeout = Name("Timeout")
|
||||
/// Topic header.
|
||||
public static let topic = Name("Topic")
|
||||
/// Trailer header.
|
||||
public static let trailer = Name("Trailer")
|
||||
/// Transfer-Encoding header.
|
||||
public static let transferEncoding = Name("Transfer-Encoding")
|
||||
/// TTL header.
|
||||
public static let ttl = Name("TTL")
|
||||
/// Urgency header.
|
||||
public static let urgency = Name("Urgency")
|
||||
/// URI header.
|
||||
public static let uri = Name("URI")
|
||||
/// Upgrade header.
|
||||
public static let upgrade = Name("Upgrade")
|
||||
/// User-Agent header.
|
||||
public static let userAgent = Name("User-Agent")
|
||||
/// Variant-Vary header.
|
||||
public static let variantVary = Name("Variant-Vary")
|
||||
/// Vary header.
|
||||
public static let vary = Name("Vary")
|
||||
/// Via header.
|
||||
public static let via = Name("Via")
|
||||
/// WWW-Authenticate header.
|
||||
public static let wwwAuthenticate = Name("WWW-Authenticate")
|
||||
/// Want-Digest header.
|
||||
public static let wantDigest = Name("Want-Digest")
|
||||
/// Warning header.
|
||||
public static let warning = Name("Warning")
|
||||
/// X-Frame-Options header.
|
||||
public static let xFrameOptions = Name("X-Frame-Options")
|
||||
|
||||
// https://www.iana.org/assignments/message-headers/message-headers.xhtml
|
||||
// Provisional Message Header Field Names
|
||||
/// Access-Control header.
|
||||
public static let accessControl = Name("Access-Control")
|
||||
/// Access-Control-Allow-Credentials header.
|
||||
public static let accessControlAllowCredentials = Name("Access-Control-Allow-Credentials")
|
||||
/// Access-Control-Allow-Headers header.
|
||||
public static let accessControlAllowHeaders = Name("Access-Control-Allow-Headers")
|
||||
/// Access-Control-Allow-Methods header.
|
||||
public static let accessControlAllowMethods = Name("Access-Control-Allow-Methods")
|
||||
/// Access-Control-Allow-Origin header.
|
||||
public static let accessControlAllowOrigin = Name("Access-Control-Allow-Origin")
|
||||
/// Access-Control-Max-Age header.
|
||||
public static let accessControlMaxAge = Name("Access-Control-Max-Age")
|
||||
/// Access-Control-Request-Method header.
|
||||
public static let accessControlRequestMethod = Name("Access-Control-Request-Method")
|
||||
/// Access-Control-Request-Headers header.
|
||||
public static let accessControlRequestHeaders = Name("Access-Control-Request-Headers")
|
||||
/// Compliance header.
|
||||
public static let compliance = Name("Compliance")
|
||||
/// Content-Transfer-Encoding header.
|
||||
public static let contentTransferEncoding = Name("Content-Transfer-Encoding")
|
||||
/// Cost header.
|
||||
public static let cost = Name("Cost")
|
||||
/// EDIINT-Features header.
|
||||
public static let ediintFeatures = Name("EDIINT-Features")
|
||||
/// Message-ID header.
|
||||
public static let messageID = Name("Message-ID")
|
||||
/// Method-Check header.
|
||||
public static let methodCheck = Name("Method-Check")
|
||||
/// Method-Check-Expires header.
|
||||
public static let methodCheckExpires = Name("Method-Check-Expires")
|
||||
/// Non-Compliance header.
|
||||
public static let nonCompliance = Name("Non-Compliance")
|
||||
/// Optional header.
|
||||
public static let optional = Name("Optional")
|
||||
/// Referer-Root header.
|
||||
public static let refererRoot = Name("Referer-Root")
|
||||
/// Resolution-Hint header.
|
||||
public static let resolutionHint = Name("Resolution-Hint")
|
||||
/// Resolver-Location header.
|
||||
public static let resolverLocation = Name("Resolver-Location")
|
||||
/// SubOK header.
|
||||
public static let subOK = Name("SubOK")
|
||||
/// Subst header.
|
||||
public static let subst = Name("Subst")
|
||||
/// Title header.
|
||||
public static let title = Name("Title")
|
||||
/// UA-Color header.
|
||||
public static let uaColor = Name("UA-Color")
|
||||
/// UA-Media header.
|
||||
public static let uaMedia = Name("UA-Media")
|
||||
/// UA-Pixels header.
|
||||
public static let uaPixels = Name("UA-Pixels")
|
||||
/// UA-Resolution header.
|
||||
public static let uaResolution = Name("UA-Resolution")
|
||||
/// UA-Windowpixels header.
|
||||
public static let uaWindowpixels = Name("UA-Windowpixels")
|
||||
/// Version header.
|
||||
public static let version = Name("Version")
|
||||
/// X-Device-Accept header.
|
||||
public static let xDeviceAccept = Name("X-Device-Accept")
|
||||
/// X-Device-Accept-Charset header.
|
||||
public static let xDeviceAcceptCharset = Name("X-Device-Accept-Charset")
|
||||
/// X-Device-Accept-Encoding header.
|
||||
public static let xDeviceAcceptEncoding = Name("X-Device-Accept-Encoding")
|
||||
/// X-Device-Accept-Language header.
|
||||
public static let xDeviceAcceptLanguage = Name("X-Device-Accept-Language")
|
||||
/// X-Device-User-Agent header.
|
||||
public static let xDeviceUserAgent = Name("X-Device-User-Agent")
|
||||
}
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
/// HTTP method structure
|
||||
public struct HTTPMethod {
|
||||
/// HTTP method
|
||||
public let method: String
|
||||
|
||||
/// Creates an HTTP method
|
||||
public init(_ method: String) {
|
||||
self.method = method.uppercased()
|
||||
}
|
||||
}
|
||||
|
||||
/// HTTP method constants
|
||||
extension HTTPMethod {
|
||||
/// DELETE method.
|
||||
public static let delete = HTTPMethod("DELETE")
|
||||
/// GET method.
|
||||
public static let get = HTTPMethod("GET")
|
||||
/// HEAD method.
|
||||
public static let head = HTTPMethod("HEAD")
|
||||
/// POST method.
|
||||
public static let post = HTTPMethod("POST")
|
||||
/// PUT method.
|
||||
public static let put = HTTPMethod("PUT")
|
||||
/// CONNECT method.
|
||||
public static let connect = HTTPMethod("CONNECT")
|
||||
/// OPTIONS method.
|
||||
public static let options = HTTPMethod("OPTIONS")
|
||||
/// TRACE method.
|
||||
public static let trace = HTTPMethod("TRACE")
|
||||
/// COPY method.
|
||||
public static let copy = HTTPMethod("COPY")
|
||||
/// LOCK method.
|
||||
public static let lock = HTTPMethod("LOCK")
|
||||
/// MKCOL method.
|
||||
public static let mkol = HTTPMethod("MKCOL")
|
||||
/// MOVE method.
|
||||
public static let move = HTTPMethod("MOVE")
|
||||
/// PROPFIND method.
|
||||
public static let propfind = HTTPMethod("PROPFIND")
|
||||
/// PROPPATCH method.
|
||||
public static let proppatch = HTTPMethod("PROPPATCH")
|
||||
/// SEARCH method.
|
||||
public static let search = HTTPMethod("SEARCH")
|
||||
/// UNLOCK method.
|
||||
public static let unlock = HTTPMethod("UNLOCK")
|
||||
/// BIND method.
|
||||
public static let bind = HTTPMethod("BIND")
|
||||
/// REBIND method.
|
||||
public static let rebind = HTTPMethod("REBIND")
|
||||
/// UNBIND method.
|
||||
public static let unbind = HTTPMethod("UNBIND")
|
||||
/// ACL method.
|
||||
public static let acl = HTTPMethod("ACL")
|
||||
/// REPORT method.
|
||||
public static let report = HTTPMethod("REPORT")
|
||||
/// MKACTIVITY method.
|
||||
public static let mkactivity = HTTPMethod("MKACTIVITY")
|
||||
/// CHECKOUT method.
|
||||
public static let checkout = HTTPMethod("CHECKOUT")
|
||||
/// MERGE method.
|
||||
public static let merge = HTTPMethod("MERGE")
|
||||
/// MSEARCH method.
|
||||
public static let msearch = HTTPMethod("MSEARCH")
|
||||
/// NOTIFY method.
|
||||
public static let notify = HTTPMethod("NOTIFY")
|
||||
/// SUBSCRIBE method.
|
||||
public static let subscribe = HTTPMethod("SUBSCRIBE")
|
||||
/// UNSUBSCRIBE method.
|
||||
public static let unsubscribe = HTTPMethod("UNSUBSCRIBE")
|
||||
/// PATCH method.
|
||||
public static let patch = HTTPMethod("PATCH")
|
||||
/// PURGE method.
|
||||
public static let purge = HTTPMethod("PURGE")
|
||||
/// MKCALENDAR method.
|
||||
public static let mkcalendar = HTTPMethod("MKCALENDAR")
|
||||
/// LINK method.
|
||||
public static let link = HTTPMethod("LINK")
|
||||
/// UNLINK method.
|
||||
public static let unlink = HTTPMethod("UNLINK")
|
||||
}
|
||||
|
||||
extension HTTPMethod : Hashable {
|
||||
|
||||
public var hashValue: Int {
|
||||
return method.hashValue
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public static func == (lhs: HTTPMethod, rhs: HTTPMethod) -> Bool {
|
||||
return lhs.method == rhs.method
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public static func ~= (match: HTTPMethod, version: HTTPMethod) -> Bool {
|
||||
return match == version
|
||||
}
|
||||
}
|
||||
|
||||
extension HTTPMethod : ExpressibleByStringLiteral {
|
||||
/// :nodoc:
|
||||
public init(stringLiteral: String) {
|
||||
self.init(stringLiteral)
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public init(unicodeScalarLiteral: String) {
|
||||
self.init(unicodeScalarLiteral)
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public init(extendedGraphemeClusterLiteral: String) {
|
||||
self.init(extendedGraphemeClusterLiteral)
|
||||
}
|
||||
}
|
||||
|
||||
extension HTTPMethod : CustomStringConvertible {
|
||||
/// :nodoc:
|
||||
public var description: String {
|
||||
return method
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Dispatch
|
||||
|
||||
/// A structure representing the headers from a HTTP request, without the body of the request.
|
||||
public struct HTTPRequest {
|
||||
/// HTTP request method.
|
||||
public var method: HTTPMethod
|
||||
/// HTTP request URI, eg. "/foo/bar?buz=qux"
|
||||
public var target: String
|
||||
/// HTTP request version
|
||||
public var httpVersion: HTTPVersion
|
||||
/// HTTP request headers
|
||||
public var headers: HTTPHeaders
|
||||
}
|
||||
|
||||
/// Method that takes a chunk of request body and is expected to write to the ResponseWriter
|
||||
/// - Parameter HTTPBodyChunk: `HTTPBodyChunk` representing some or all of the incoming request body
|
||||
/// - Parameter Bool: Bool that can be set to true in order to prevent further processing
|
||||
public typealias HTTPBodyHandler = (HTTPBodyChunk, inout Bool) -> Void
|
||||
|
||||
/// Indicates whether the body is going to be processed or ignored
|
||||
public enum HTTPBodyProcessing {
|
||||
/// Used to discard the body data associated with the incoming HTTP request
|
||||
case discardBody
|
||||
/// Used to process the body data associated with the imcoming HTTP request using a `HTTPBodyHandler`
|
||||
case processBody(handler: HTTPBodyHandler)
|
||||
}
|
||||
|
||||
/// Part or all of the incoming request body
|
||||
public enum HTTPBodyChunk {
|
||||
/// A new chunk of the incoming HTTP reqest body data has arrived. `finishedProcessing()` must be called when
|
||||
/// that chunk has been processed.
|
||||
case chunk(data: DispatchData, finishedProcessing: () -> Void)
|
||||
/// An error has occurred whilst streaming the incoming HTTP request data, eg. the connection closed
|
||||
case failed(error: Error)
|
||||
/// A trailer header has arrived during the processing of the incoming HTTP request data.
|
||||
/// This is currently unimplemented.
|
||||
case trailer(key: String, value: String)
|
||||
/// The stream of incoming HTTP request data has completed.
|
||||
case end
|
||||
}
|
||||
@@ -1,391 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Dispatch
|
||||
|
||||
/// A structure representing the headers for a HTTP response, without the body of the response.
|
||||
public struct HTTPResponse {
|
||||
/// HTTP response version
|
||||
public var httpVersion : HTTPVersion
|
||||
/// HTTP response status
|
||||
public var status: HTTPResponseStatus
|
||||
/// HTTP response headers
|
||||
public var headers: HTTPHeaders
|
||||
}
|
||||
|
||||
/// HTTPResponseWriter provides functions to create an HTTP response
|
||||
public protocol HTTPResponseWriter : class {
|
||||
|
||||
/// writeHeader: Writer function to create the headers for an HTTP response
|
||||
/// - Parameter status: The status code to include in the HTTP response
|
||||
/// - Parameter headers: The HTTP headers to include in the HTTP response
|
||||
/// - Parameter completion: Closure that is called when the HTTP headers have been written to the HTTP respose
|
||||
func writeHeader(status: HTTPResponseStatus, headers: HTTPHeaders, completion: @escaping (Result) -> Void)
|
||||
|
||||
/// writeTrailer: Writer function to write a trailer header as part of the HTTP response
|
||||
/// - Parameter trailers: The trailers to write as part of the HTTP response
|
||||
/// - Parameter completion: Closure that is called when the trailers has been written to the HTTP response
|
||||
/// This is not currently implemented
|
||||
func writeTrailer(_ trailers: HTTPHeaders, completion: @escaping (Result) -> Void)
|
||||
|
||||
/// writeBody: Writer function to write data to the body of the HTTP response
|
||||
/// - Parameter data: The data to write as part of the HTTP response
|
||||
/// - Parameter completion: Closure that is called when the data has been written to the HTTP response
|
||||
func writeBody(_ data: UnsafeHTTPResponseBody, completion: @escaping (Result) -> Void)
|
||||
|
||||
/// done: Writer function to complete the HTTP response
|
||||
/// - Parameter completion: Closure that is called when the HTTP response has been completed
|
||||
func done(completion: @escaping (Result) -> Void)
|
||||
|
||||
/// abort: Abort the HTTP response
|
||||
func abort()
|
||||
}
|
||||
|
||||
/// Convenience methods for HTTP response writer.
|
||||
extension HTTPResponseWriter {
|
||||
/// Convenience funtion to write the headers for an HTTP response without a completion handler
|
||||
/// - See: `writeHeader(status:headers:completion:)`
|
||||
public func writeHeader(status: HTTPResponseStatus, headers: HTTPHeaders) {
|
||||
writeHeader(status: status, headers: headers) { _ in }
|
||||
}
|
||||
|
||||
/// Convenience funtion to write a HTTP response with no headers or completion handler
|
||||
/// - See: `writeHeader(status:headers:completion:)`
|
||||
public func writeHeader(status: HTTPResponseStatus) {
|
||||
writeHeader(status: status, headers: [:])
|
||||
}
|
||||
|
||||
/// Convenience function to write a trailer header as part of the HTTP response without a completion handler
|
||||
/// - See: `writeTrailer(_:completion:)`
|
||||
public func writeTrailer(_ trailers: HTTPHeaders) {
|
||||
writeTrailer(trailers) { _ in }
|
||||
}
|
||||
|
||||
/// Convenience function for writing `data` to the body of the HTTP response without a completion handler.
|
||||
/// - See: writeBody(_:completion:)
|
||||
public func writeBody(_ data: UnsafeHTTPResponseBody) {
|
||||
return writeBody(data) { _ in }
|
||||
}
|
||||
|
||||
/// Convenience function to complete the HTTP response without a completion handler.
|
||||
/// - See: done(completion:)
|
||||
public func done() {
|
||||
done { _ in }
|
||||
}
|
||||
}
|
||||
|
||||
/// The response status for the HTTP response
|
||||
/// - See: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml for more information
|
||||
public struct HTTPResponseStatus: Equatable, CustomStringConvertible, ExpressibleByIntegerLiteral {
|
||||
/// The status code, eg. 200 or 404
|
||||
public let code: Int
|
||||
/// The reason phrase for the status code
|
||||
public let reasonPhrase: String
|
||||
|
||||
/// Creates an HTTP response status
|
||||
/// - Parameter code: The status code used for the response status
|
||||
/// - Parameter reasonPhrase: The reason phrase to use for the response status
|
||||
public init(code: Int, reasonPhrase: String) {
|
||||
self.code = code
|
||||
self.reasonPhrase = reasonPhrase
|
||||
}
|
||||
|
||||
/// Creates an HTTP response status
|
||||
/// The reason phrase is added for the status code, or "http_(code)" if the code is not well known
|
||||
/// - Parameter code: The status code used for the response status
|
||||
public init(code: Int) {
|
||||
self.init(code: code, reasonPhrase: HTTPResponseStatus.defaultReasonPhrase(forCode: code))
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public init(integerLiteral: Int) {
|
||||
self.init(code: integerLiteral)
|
||||
}
|
||||
|
||||
/* all the codes from http://www.iana.org/assignments/http-status-codes */
|
||||
/// 100 Continue
|
||||
public static let `continue` = HTTPResponseStatus(code: 100)
|
||||
/// 101 Switching Protocols
|
||||
public static let switchingProtocols = HTTPResponseStatus(code: 101)
|
||||
/// 200 OK
|
||||
public static let ok = HTTPResponseStatus(code: 200)
|
||||
/// 201 Created
|
||||
public static let created = HTTPResponseStatus(code: 201)
|
||||
/// 202 Accepted
|
||||
public static let accepted = HTTPResponseStatus(code: 202)
|
||||
/// 203 Non-Authoritative Information
|
||||
public static let nonAuthoritativeInformation = HTTPResponseStatus(code: 203)
|
||||
/// 204 No Content
|
||||
public static let noContent = HTTPResponseStatus(code: 204)
|
||||
/// 205 Reset Content
|
||||
public static let resetContent = HTTPResponseStatus(code: 205)
|
||||
/// 206 Partial Content
|
||||
public static let partialContent = HTTPResponseStatus(code: 206)
|
||||
/// 207 Multi-Status
|
||||
public static let multiStatus = HTTPResponseStatus(code: 207)
|
||||
/// 208 Already Reported
|
||||
public static let alreadyReported = HTTPResponseStatus(code: 208)
|
||||
/// 226 IM Used
|
||||
public static let imUsed = HTTPResponseStatus(code: 226)
|
||||
/// 300 Multiple Choices
|
||||
public static let multipleChoices = HTTPResponseStatus(code: 300)
|
||||
/// 301 Moved Permanently
|
||||
public static let movedPermanently = HTTPResponseStatus(code: 301)
|
||||
/// 302 Found
|
||||
public static let found = HTTPResponseStatus(code: 302)
|
||||
/// 303 See Other
|
||||
public static let seeOther = HTTPResponseStatus(code: 303)
|
||||
/// 304 Not Modified
|
||||
public static let notModified = HTTPResponseStatus(code: 304)
|
||||
/// 305 Use Proxy
|
||||
public static let useProxy = HTTPResponseStatus(code: 305)
|
||||
/// 307 Temporary Redirect
|
||||
public static let temporaryRedirect = HTTPResponseStatus(code: 307)
|
||||
/// 308 Permanent Redirect
|
||||
public static let permanentRedirect = HTTPResponseStatus(code: 308)
|
||||
/// 400 Bad Request
|
||||
public static let badRequest = HTTPResponseStatus(code: 400)
|
||||
/// 401 Unauthorized
|
||||
public static let unauthorized = HTTPResponseStatus(code: 401)
|
||||
/// 402 Payment Required
|
||||
public static let paymentRequired = HTTPResponseStatus(code: 402)
|
||||
/// 403 Forbidden
|
||||
public static let forbidden = HTTPResponseStatus(code: 403)
|
||||
/// 404 Not Found
|
||||
public static let notFound = HTTPResponseStatus(code: 404)
|
||||
/// 405 Method Not Allowed
|
||||
public static let methodNotAllowed = HTTPResponseStatus(code: 405)
|
||||
/// 406 Not Acceptable
|
||||
public static let notAcceptable = HTTPResponseStatus(code: 406)
|
||||
/// 407 Proxy Authentication Required
|
||||
public static let proxyAuthenticationRequired = HTTPResponseStatus(code: 407)
|
||||
/// 408 Request Timeout
|
||||
public static let requestTimeout = HTTPResponseStatus(code: 408)
|
||||
/// 409 Conflict
|
||||
public static let conflict = HTTPResponseStatus(code: 409)
|
||||
/// 410 Gone
|
||||
public static let gone = HTTPResponseStatus(code: 410)
|
||||
/// 411 Length Required
|
||||
public static let lengthRequired = HTTPResponseStatus(code: 411)
|
||||
/// 412 Precondition Failed
|
||||
public static let preconditionFailed = HTTPResponseStatus(code: 412)
|
||||
/// 413 Payload Too Large
|
||||
public static let payloadTooLarge = HTTPResponseStatus(code: 413)
|
||||
/// 414 URI Too Long
|
||||
public static let uriTooLong = HTTPResponseStatus(code: 414)
|
||||
/// 415 Unsupported Media Type
|
||||
public static let unsupportedMediaType = HTTPResponseStatus(code: 415)
|
||||
/// 416 Range Not Satisfiable
|
||||
public static let rangeNotSatisfiable = HTTPResponseStatus(code: 416)
|
||||
/// 417 Expectation Failed
|
||||
public static let expectationFailed = HTTPResponseStatus(code: 417)
|
||||
/// 421 Misdirected Request
|
||||
public static let misdirectedRequest = HTTPResponseStatus(code: 421)
|
||||
/// 422 Unprocessable Entity
|
||||
public static let unprocessableEntity = HTTPResponseStatus(code: 422)
|
||||
/// 423 Locked
|
||||
public static let locked = HTTPResponseStatus(code: 423)
|
||||
/// 424 Failed Dependency
|
||||
public static let failedDependency = HTTPResponseStatus(code: 424)
|
||||
/// 426 Upgrade Required
|
||||
public static let upgradeRequired = HTTPResponseStatus(code: 426)
|
||||
/// 428 Precondition Required
|
||||
public static let preconditionRequired = HTTPResponseStatus(code: 428)
|
||||
/// 429 Too Many Requests
|
||||
public static let tooManyRequests = HTTPResponseStatus(code: 429)
|
||||
/// 431 Request Header Fields Too Large
|
||||
public static let requestHeaderFieldsTooLarge = HTTPResponseStatus(code: 431)
|
||||
/// 451 Unavailable For Legal Reasons
|
||||
public static let unavailableForLegalReasons = HTTPResponseStatus(code: 451)
|
||||
/// 500 Internal Server Error
|
||||
public static let internalServerError = HTTPResponseStatus(code: 500)
|
||||
/// 501 Not Implemented
|
||||
public static let notImplemented = HTTPResponseStatus(code: 501)
|
||||
/// 502 Bad Gateway
|
||||
public static let badGateway = HTTPResponseStatus(code: 502)
|
||||
/// 503 Service Unavailable
|
||||
public static let serviceUnavailable = HTTPResponseStatus(code: 503)
|
||||
/// 504 Gateway Timeout
|
||||
public static let gatewayTimeout = HTTPResponseStatus(code: 504)
|
||||
/// 505 HTTP Version Not Supported
|
||||
public static let httpVersionNotSupported = HTTPResponseStatus(code: 505)
|
||||
/// 506 Variant Also Negotiates
|
||||
public static let variantAlsoNegotiates = HTTPResponseStatus(code: 506)
|
||||
/// 507 Insufficient Storage
|
||||
public static let insufficientStorage = HTTPResponseStatus(code: 507)
|
||||
/// 508 Loop Detected
|
||||
public static let loopDetected = HTTPResponseStatus(code: 508)
|
||||
/// 510 Not Extended
|
||||
public static let notExtended = HTTPResponseStatus(code: 510)
|
||||
/// 511 Network Authentication Required
|
||||
public static let networkAuthenticationRequired = HTTPResponseStatus(code: 511)
|
||||
|
||||
static func defaultReasonPhrase(forCode code: Int) -> String {
|
||||
switch code {
|
||||
case 100: return "Continue"
|
||||
case 101: return "Switching Protocols"
|
||||
case 200: return "OK"
|
||||
case 201: return "Created"
|
||||
case 202: return "Accepted"
|
||||
case 203: return "Non-Authoritative Information"
|
||||
case 204: return "No Content"
|
||||
case 205: return "Reset Content"
|
||||
case 206: return "Partial Content"
|
||||
case 207: return "Multi-Status"
|
||||
case 208: return "Already Reported"
|
||||
case 226: return "IM Used"
|
||||
case 300: return "Multiple Choices"
|
||||
case 301: return "Moved Permanently"
|
||||
case 302: return "Found"
|
||||
case 303: return "See Other"
|
||||
case 304: return "Not Modified"
|
||||
case 305: return "Use Proxy"
|
||||
case 307: return "Temporary Redirect"
|
||||
case 308: return "Permanent Redirect"
|
||||
case 400: return "Bad Request"
|
||||
case 401: return "Unauthorized"
|
||||
case 402: return "Payment Required"
|
||||
case 403: return "Forbidden"
|
||||
case 404: return "Not Found"
|
||||
case 405: return "Method Not Allowed"
|
||||
case 406: return "Not Acceptable"
|
||||
case 407: return "Proxy Authentication Required"
|
||||
case 408: return "Request Timeout"
|
||||
case 409: return "Conflict"
|
||||
case 410: return "Gone"
|
||||
case 411: return "Length Required"
|
||||
case 412: return "Precondition Failed"
|
||||
case 413: return "Payload Too Large"
|
||||
case 414: return "URI Too Long"
|
||||
case 415: return "Unsupported Media Type"
|
||||
case 416: return "Range Not Satisfiable"
|
||||
case 417: return "Expectation Failed"
|
||||
case 421: return "Misdirected Request"
|
||||
case 422: return "Unprocessable Entity"
|
||||
case 423: return "Locked"
|
||||
case 424: return "Failed Dependency"
|
||||
case 426: return "Upgrade Required"
|
||||
case 428: return "Precondition Required"
|
||||
case 429: return "Too Many Requests"
|
||||
case 431: return "Request Header Fields Too Large"
|
||||
case 451: return "Unavailable For Legal Reasons"
|
||||
case 500: return "Internal Server Error"
|
||||
case 501: return "Not Implemented"
|
||||
case 502: return "Bad Gateway"
|
||||
case 503: return "Service Unavailable"
|
||||
case 504: return "Gateway Timeout"
|
||||
case 505: return "HTTP Version Not Supported"
|
||||
case 506: return "Variant Also Negotiates"
|
||||
case 507: return "Insufficient Storage"
|
||||
case 508: return "Loop Detected"
|
||||
case 510: return "Not Extended"
|
||||
case 511: return "Network Authentication Required"
|
||||
default: return "http_\(code)"
|
||||
}
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public var description: String {
|
||||
return "\(code) \(reasonPhrase)"
|
||||
}
|
||||
|
||||
/// - The `Class` representing the class of status code for this response status
|
||||
public var `class`: Class {
|
||||
return Class(code: code)
|
||||
}
|
||||
|
||||
/// The class of a `HTTPResponseStatus` code
|
||||
/// - See: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml for more information
|
||||
public enum Class {
|
||||
/// Informational: the request was received, and is continuing to be processed
|
||||
case informational
|
||||
/// Success: the action was successfully received, understood, and accepted
|
||||
case successful
|
||||
/// Redirection: further action must be taken in order to complete the request
|
||||
case redirection
|
||||
/// Client Error: the request contains bad syntax or cannot be fulfilled
|
||||
case clientError
|
||||
/// Server Error: the server failed to fulfill an apparently valid request
|
||||
case serverError
|
||||
/// Invalid: the code does not map to a well known status code class
|
||||
case invalidStatus
|
||||
|
||||
init(code: Int) {
|
||||
switch code {
|
||||
case 100..<200: self = .informational
|
||||
case 200..<300: self = .successful
|
||||
case 300..<400: self = .redirection
|
||||
case 400..<500: self = .clientError
|
||||
case 500..<600: self = .serverError
|
||||
default: self = .invalidStatus
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [RFC2616, section 4.4]
|
||||
var bodyAllowed: Bool {
|
||||
switch code {
|
||||
case 100..<200: return false
|
||||
case 204: return false
|
||||
case 304: return false
|
||||
default: return true
|
||||
}
|
||||
}
|
||||
|
||||
var suppressedHeaders: [HTTPHeaders.Name] {
|
||||
if self == .notModified {
|
||||
return ["Content-Type", "Content-Length", "Transfer-Encoding"]
|
||||
} else if !bodyAllowed {
|
||||
return ["Content-Length", "Transfer-Encoding"]
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public static func ==(lhs: HTTPResponseStatus, rhs: HTTPResponseStatus) -> Bool {
|
||||
return lhs.code == rhs.code
|
||||
}
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public protocol UnsafeHTTPResponseBody {
|
||||
func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
extension UnsafeRawBufferPointer : UnsafeHTTPResponseBody {
|
||||
public func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R {
|
||||
return try body(self)
|
||||
}
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public protocol HTTPResponseBody : UnsafeHTTPResponseBody {}
|
||||
|
||||
extension Data : HTTPResponseBody {
|
||||
/// :nodoc:
|
||||
public func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R {
|
||||
return try withUnsafeBytes { try body(UnsafeRawBufferPointer(start: $0, count: count)) }
|
||||
}
|
||||
}
|
||||
|
||||
extension DispatchData : HTTPResponseBody {
|
||||
/// :nodoc:
|
||||
public func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R {
|
||||
return try withUnsafeBytes { try body(UnsafeRawBufferPointer(start: $0, count: count)) }
|
||||
}
|
||||
}
|
||||
|
||||
extension String : HTTPResponseBody {
|
||||
/// :nodoc:
|
||||
public func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R {
|
||||
return try ContiguousArray(utf8).withUnsafeBytes(body)
|
||||
}
|
||||
}
|
||||
@@ -1,491 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Dispatch
|
||||
|
||||
import CHTTPParser
|
||||
|
||||
|
||||
/// Class that wraps the CHTTPParser and calls the `WebApp` to get the response
|
||||
/// :nodoc:
|
||||
public class StreamingParser: HTTPResponseWriter {
|
||||
|
||||
let webapp: WebApp
|
||||
|
||||
/// Time to leave socket open waiting for next request to start
|
||||
public static let keepAliveTimeout: TimeInterval = 5
|
||||
|
||||
/// Flag to track if the client wants to send multiple requests on the same TCP connection
|
||||
var clientRequestedKeepAlive = false
|
||||
|
||||
|
||||
/// Tracks when socket should be closed. Needs to have a lock, since it's updated often
|
||||
private let _keepAliveUntilLock = DispatchSemaphore(value: 1)
|
||||
private var _keepAliveUntil: TimeInterval?
|
||||
public var keepAliveUntil: TimeInterval? {
|
||||
get {
|
||||
_keepAliveUntilLock.wait()
|
||||
defer {
|
||||
_keepAliveUntilLock.signal()
|
||||
}
|
||||
return _keepAliveUntil
|
||||
}
|
||||
set {
|
||||
_keepAliveUntilLock.wait()
|
||||
defer {
|
||||
_keepAliveUntilLock.signal()
|
||||
}
|
||||
_keepAliveUntil = newValue
|
||||
}
|
||||
}
|
||||
|
||||
/// Theoretical limit of how many open requests we can have. Used in Keep-Alive Header
|
||||
let maxRequests = 100
|
||||
|
||||
/// Optional delegate that can tell us how many connections are in-flight so we can set the Keep-Alive header
|
||||
/// to the correct number of available connections. If not present, the client will not be limited in number of
|
||||
/// connections that can be made simultaneously
|
||||
public weak var connectionCounter: CurrentConnectionCounting?
|
||||
|
||||
/// Holds the bytes that come from the CHTTPParser until we have enough of them to do something with it
|
||||
var parserBuffer: Data?
|
||||
|
||||
/// HTTP Parser
|
||||
var httpParser = http_parser()
|
||||
var httpParserSettings = http_parser_settings()
|
||||
|
||||
/// Block that takes a chunk from the HTTPParser as input and writes to a Response as a result
|
||||
var httpBodyProcessingCallback: HTTPBodyProcessing?
|
||||
|
||||
//Note: we want this to be strong so it holds onto the connector until it's explicitly cleared
|
||||
/// Protocol that we use to send data (and status info) back to the Network layer
|
||||
public var parserConnector: ParserConnecting?
|
||||
|
||||
var lastCallBack = CallbackRecord.idle
|
||||
var lastHeaderName: String?
|
||||
var parsedHeaders = HTTPHeaders()
|
||||
var parsedHTTPMethod: HTTPMethod?
|
||||
var parsedHTTPVersion: HTTPVersion?
|
||||
var parsedURL: String?
|
||||
|
||||
/// Is the currently parsed request an upgrade request?
|
||||
public private(set) var upgradeRequested = false
|
||||
|
||||
/// Class that wraps the CHTTPParser and calls the `WebApp` to get the response
|
||||
///
|
||||
/// - Parameter webapp: function that is used to create the response
|
||||
public init(webapp: @escaping WebApp, connectionCounter: CurrentConnectionCounting? = nil) {
|
||||
self.webapp = webapp
|
||||
self.connectionCounter = connectionCounter
|
||||
|
||||
//Set up all the callbacks for the CHTTPParser library
|
||||
httpParserSettings.on_message_begin = {
|
||||
parser -> Int32 in
|
||||
guard let listener = StreamingParser.getSelf(parser: parser) else {
|
||||
return Int32(0)
|
||||
}
|
||||
return listener.messageBegan()
|
||||
}
|
||||
|
||||
httpParserSettings.on_message_complete = {
|
||||
parser -> Int32 in
|
||||
guard let listener = StreamingParser.getSelf(parser: parser) else {
|
||||
return Int32(0)
|
||||
}
|
||||
return listener.messageCompleted()
|
||||
}
|
||||
|
||||
httpParserSettings.on_headers_complete = {
|
||||
parser -> Int32 in
|
||||
guard let listener = StreamingParser.getSelf(parser: parser) else {
|
||||
return Int32(0)
|
||||
}
|
||||
let methodId = parser?.pointee.method
|
||||
let methodName = String(validatingUTF8:http_method_str(http_method(rawValue: methodId ?? 0))) ?? "GET"
|
||||
let major = Int(parser?.pointee.http_major ?? 0)
|
||||
let minor = Int(parser?.pointee.http_minor ?? 0)
|
||||
|
||||
//This needs to be set here and not messageCompleted if it's going to work here
|
||||
let keepAlive = (http_should_keep_alive(parser) == 1)
|
||||
let upgradeRequested = get_upgrade_value(parser) == 1
|
||||
|
||||
return listener.headersCompleted(methodName: methodName, majorVersion: major, minorVersion: minor, keepAlive: keepAlive, upgrade: upgradeRequested)
|
||||
}
|
||||
|
||||
httpParserSettings.on_header_field = {
|
||||
(parser, chunk, length) -> Int32 in
|
||||
guard let listener = StreamingParser.getSelf(parser: parser) else {
|
||||
return Int32(0)
|
||||
}
|
||||
return listener.headerFieldReceived(data: chunk, length: length)
|
||||
}
|
||||
|
||||
httpParserSettings.on_header_value = {
|
||||
(parser, chunk, length) -> Int32 in
|
||||
guard let listener = StreamingParser.getSelf(parser: parser) else {
|
||||
return Int32(0)
|
||||
}
|
||||
return listener.headerValueReceived(data: chunk, length: length)
|
||||
}
|
||||
|
||||
httpParserSettings.on_body = {
|
||||
(parser, chunk, length) -> Int32 in
|
||||
guard let listener = StreamingParser.getSelf(parser: parser) else {
|
||||
return Int32(0)
|
||||
}
|
||||
return listener.bodyReceived(data: chunk, length: length)
|
||||
}
|
||||
|
||||
httpParserSettings.on_url = {
|
||||
(parser, chunk, length) -> Int32 in
|
||||
guard let listener = StreamingParser.getSelf(parser: parser) else {
|
||||
return Int32(0)
|
||||
}
|
||||
return listener.urlReceived(data: chunk, length: length)
|
||||
}
|
||||
http_parser_init(&httpParser, HTTP_REQUEST)
|
||||
|
||||
self.httpParser.data = Unmanaged.passUnretained(self).toOpaque()
|
||||
|
||||
}
|
||||
|
||||
/// Read a stream from the network, pass it to the parser and return number of bytes consumed
|
||||
///
|
||||
/// - Parameter data: data coming from network
|
||||
/// - Returns: number of bytes that we sent to the parser
|
||||
public func readStream(data: Data) -> Int {
|
||||
return data.withUnsafeBytes { (ptr) -> Int in
|
||||
return http_parser_execute(&self.httpParser, &self.httpParserSettings, ptr, data.count)
|
||||
}
|
||||
}
|
||||
|
||||
/// States to track where we are in parsing the HTTP Stream from the client
|
||||
enum CallbackRecord {
|
||||
case idle, messageBegan, messageCompleted, headersCompleted, headerFieldReceived, headerValueReceived, bodyReceived, urlReceived
|
||||
}
|
||||
|
||||
/// Process change of state as we get more and more parser callbacks
|
||||
///
|
||||
/// - Parameter currentCallBack: state we are entering, as specified by the CHTTPParser
|
||||
/// - Returns: Whether or not the state actually changed
|
||||
@discardableResult
|
||||
func processCurrentCallback(_ currentCallBack:CallbackRecord) -> Bool {
|
||||
if lastCallBack == currentCallBack {
|
||||
return false
|
||||
}
|
||||
switch lastCallBack {
|
||||
case .headerFieldReceived:
|
||||
if let parserBuffer = self.parserBuffer {
|
||||
self.lastHeaderName = String(data: parserBuffer, encoding: .utf8)
|
||||
self.parserBuffer=nil
|
||||
} else {
|
||||
print("Missing parserBuffer after \(lastCallBack)")
|
||||
}
|
||||
case .headerValueReceived:
|
||||
if let parserBuffer = self.parserBuffer, let lastHeaderName = self.lastHeaderName, let headerValue = String(data:parserBuffer, encoding: .utf8) {
|
||||
self.parsedHeaders.append([HTTPHeaders.Name(lastHeaderName): headerValue])
|
||||
self.lastHeaderName = nil
|
||||
self.parserBuffer=nil
|
||||
} else {
|
||||
print("Missing parserBuffer after \(lastCallBack)")
|
||||
}
|
||||
case .headersCompleted:
|
||||
self.parserBuffer=nil
|
||||
|
||||
if !upgradeRequested {
|
||||
self.httpBodyProcessingCallback = self.webapp(self.createRequest(), self)
|
||||
}
|
||||
case .urlReceived:
|
||||
if let parserBuffer = self.parserBuffer {
|
||||
//Under heaptrack, this may appear to leak via _CFGetTSDCreateIfNeeded,
|
||||
// apparently, that's because it triggers thread metadata to be created
|
||||
self.parsedURL = String(data:parserBuffer, encoding: .utf8)
|
||||
self.parserBuffer=nil
|
||||
} else {
|
||||
print("Missing parserBuffer after \(lastCallBack)")
|
||||
}
|
||||
case .idle:
|
||||
break
|
||||
case .messageBegan:
|
||||
break
|
||||
case .messageCompleted:
|
||||
break
|
||||
case .bodyReceived:
|
||||
break
|
||||
}
|
||||
lastCallBack = currentCallBack
|
||||
return true
|
||||
}
|
||||
|
||||
func messageBegan() -> Int32 {
|
||||
processCurrentCallback(.messageBegan)
|
||||
self.parserConnector?.responseBeginning()
|
||||
return 0
|
||||
}
|
||||
|
||||
func messageCompleted() -> Int32 {
|
||||
let didChangeState = processCurrentCallback(.messageCompleted)
|
||||
if let chunkHandler = self.httpBodyProcessingCallback, didChangeState {
|
||||
var stop=false
|
||||
switch chunkHandler {
|
||||
case .processBody(let handler):
|
||||
handler(.end, &stop)
|
||||
case .discardBody:
|
||||
done()
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func headersCompleted(methodName:String, majorVersion: Int, minorVersion:Int, keepAlive: Bool, upgrade:Bool) -> Int32 {
|
||||
processCurrentCallback(.headersCompleted)
|
||||
self.parsedHTTPMethod = HTTPMethod(methodName)
|
||||
self.parsedHTTPVersion = HTTPVersion(major: majorVersion, minor: minorVersion)
|
||||
|
||||
//This needs to be set here and not messageCompleted if it's going to work here
|
||||
self.clientRequestedKeepAlive = keepAlive
|
||||
self.keepAliveUntil = Date(timeIntervalSinceNow: StreamingParser.keepAliveTimeout).timeIntervalSinceReferenceDate
|
||||
self.upgradeRequested = upgrade
|
||||
return 0
|
||||
}
|
||||
|
||||
func headerFieldReceived(data: UnsafePointer<Int8>?, length: Int) -> Int32 {
|
||||
processCurrentCallback(.headerFieldReceived)
|
||||
guard let data = data else { return 0 }
|
||||
data.withMemoryRebound(to: UInt8.self, capacity: length) { (ptr) -> Void in
|
||||
self.parserBuffer == nil ? self.parserBuffer = Data(bytes:data, count:length) : self.parserBuffer?.append(ptr, count:length)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func headerValueReceived(data: UnsafePointer<Int8>?, length: Int) -> Int32 {
|
||||
processCurrentCallback(.headerValueReceived)
|
||||
guard let data = data else { return 0 }
|
||||
data.withMemoryRebound(to: UInt8.self, capacity: length) { (ptr) -> Void in
|
||||
self.parserBuffer == nil ? self.parserBuffer = Data(bytes:data, count:length) : self.parserBuffer?.append(ptr, count:length)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func bodyReceived(data: UnsafePointer<Int8>?, length: Int) -> Int32 {
|
||||
processCurrentCallback(.bodyReceived)
|
||||
guard let data = data else { return 0 }
|
||||
data.withMemoryRebound(to: UInt8.self, capacity: length) { (ptr) -> Void in
|
||||
let buff = UnsafeBufferPointer<UInt8>(start: ptr, count: length)
|
||||
let chunk = DispatchData(bytes:buff)
|
||||
if let chunkHandler = self.httpBodyProcessingCallback {
|
||||
var stop=false
|
||||
var finished=false
|
||||
while !stop && !finished {
|
||||
switch chunkHandler {
|
||||
case .processBody(let handler):
|
||||
handler(.chunk(data: chunk, finishedProcessing: {
|
||||
finished=true
|
||||
}), &stop)
|
||||
case .discardBody:
|
||||
finished=true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func urlReceived(data: UnsafePointer<Int8>?, length: Int) -> Int32 {
|
||||
processCurrentCallback(.urlReceived)
|
||||
guard let data = data else { return 0 }
|
||||
data.withMemoryRebound(to: UInt8.self, capacity: length) { (ptr) -> Void in
|
||||
self.parserBuffer == nil ? self.parserBuffer = Data(bytes:data, count:length) : self.parserBuffer?.append(ptr, count:length)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
static func getSelf(parser: UnsafeMutablePointer<http_parser>?) -> StreamingParser? {
|
||||
guard let pointee = parser?.pointee.data else { return nil }
|
||||
return Unmanaged<StreamingParser>.fromOpaque(pointee).takeUnretainedValue()
|
||||
}
|
||||
|
||||
var headersWritten = false
|
||||
var isChunked = false
|
||||
|
||||
/// Create a `HTTPRequest` struct from the parsed information
|
||||
public func createRequest() -> HTTPRequest {
|
||||
return HTTPRequest(method: parsedHTTPMethod!, target: parsedURL!, httpVersion: parsedHTTPVersion!, headers: parsedHeaders)
|
||||
}
|
||||
|
||||
public func writeHeader(status: HTTPResponseStatus, headers: HTTPHeaders, completion: @escaping (Result) -> Void) {
|
||||
// TODO call completion()
|
||||
guard !headersWritten else {
|
||||
return
|
||||
}
|
||||
|
||||
var header = "HTTP/1.1 \(status.code) \(status.reasonPhrase)\r\n"
|
||||
|
||||
let isContinue = status == .continue
|
||||
|
||||
var headers = headers
|
||||
if !isContinue {
|
||||
adjustHeaders(status: status, headers: &headers)
|
||||
}
|
||||
|
||||
for (key, value) in headers {
|
||||
// TODO encode value using [RFC5987]
|
||||
header += "\(key): \(value)\r\n"
|
||||
}
|
||||
header.append("\r\n")
|
||||
|
||||
// FIXME headers are US-ASCII, anything else should be encoded using [RFC5987] some lines above
|
||||
// TODO use requested encoding if specified
|
||||
if let data = header.data(using: .utf8) {
|
||||
self.parserConnector?.queueSocketWrite(data)
|
||||
if !isContinue {
|
||||
headersWritten = true
|
||||
}
|
||||
} else {
|
||||
//TODO handle encoding error
|
||||
}
|
||||
}
|
||||
|
||||
func adjustHeaders(status: HTTPResponseStatus, headers: inout HTTPHeaders) {
|
||||
for header in status.suppressedHeaders {
|
||||
headers[header] = nil
|
||||
}
|
||||
|
||||
if headers[.contentLength] != nil {
|
||||
headers[.transferEncoding] = "identity"
|
||||
} else if parsedHTTPVersion! >= HTTPVersion(major: 1, minor: 1) {
|
||||
switch headers[.transferEncoding] {
|
||||
case .some("identity"): // identity without content-length
|
||||
clientRequestedKeepAlive = false
|
||||
case .some("chunked"):
|
||||
isChunked = true
|
||||
default:
|
||||
isChunked = true
|
||||
headers[.transferEncoding] = "chunked"
|
||||
}
|
||||
} else {
|
||||
// HTTP 1.0 does not support chunked
|
||||
clientRequestedKeepAlive = false
|
||||
headers[.transferEncoding] = nil
|
||||
}
|
||||
|
||||
let availableConnections = maxRequests - (self.connectionCounter?.connectionCount ?? 0)
|
||||
|
||||
if clientRequestedKeepAlive && (availableConnections > 0) {
|
||||
headers[.connection] = "Keep-Alive"
|
||||
headers[.keepAlive] = "timeout=\(Int(StreamingParser.keepAliveTimeout)), max=\(availableConnections)"
|
||||
} else {
|
||||
headers[.connection] = "Close"
|
||||
}
|
||||
}
|
||||
|
||||
public func writeTrailer(_ trailers: HTTPHeaders, completion: @escaping (Result) -> Void) {
|
||||
fatalError("Not implemented")
|
||||
}
|
||||
|
||||
public func writeBody(_ data: UnsafeHTTPResponseBody, completion: @escaping (Result) -> Void) {
|
||||
guard headersWritten else {
|
||||
//TODO error or default headers?
|
||||
return
|
||||
}
|
||||
|
||||
guard data.withUnsafeBytes({ $0.count > 0 }) else {
|
||||
completion(.ok)
|
||||
return
|
||||
}
|
||||
|
||||
let dataToWrite: Data
|
||||
if isChunked {
|
||||
dataToWrite = data.withUnsafeBytes {
|
||||
let chunkStart = (String($0.count, radix: 16) + "\r\n").data(using: .utf8)!
|
||||
var dataToWrite = chunkStart
|
||||
dataToWrite.append(UnsafeBufferPointer(start: $0.baseAddress?.assumingMemoryBound(to: UInt8.self), count: $0.count))
|
||||
let chunkEnd = "\r\n".data(using: .utf8)!
|
||||
dataToWrite.append(chunkEnd)
|
||||
return dataToWrite
|
||||
}
|
||||
} else if let d = data as? Data {
|
||||
dataToWrite = d
|
||||
} else {
|
||||
dataToWrite = data.withUnsafeBytes { Data($0) }
|
||||
}
|
||||
|
||||
self.parserConnector?.queueSocketWrite(dataToWrite)
|
||||
|
||||
completion(.ok)
|
||||
}
|
||||
|
||||
public func done(completion: @escaping (Result) -> Void) {
|
||||
if isChunked {
|
||||
let chunkTerminate = "0\r\n\r\n".data(using: .utf8)!
|
||||
self.parserConnector?.queueSocketWrite(chunkTerminate)
|
||||
}
|
||||
|
||||
self.parsedHTTPMethod = nil
|
||||
self.parsedURL=nil
|
||||
self.parsedHeaders = HTTPHeaders()
|
||||
self.lastHeaderName = nil
|
||||
self.parserBuffer = nil
|
||||
self.parsedHTTPMethod = nil
|
||||
self.parsedHTTPVersion = nil
|
||||
self.lastCallBack = .idle
|
||||
self.headersWritten = false
|
||||
self.httpBodyProcessingCallback = nil
|
||||
self.upgradeRequested = false
|
||||
|
||||
let closeAfter = {
|
||||
if self.clientRequestedKeepAlive {
|
||||
self.keepAliveUntil = Date(timeIntervalSinceNow:StreamingParser.keepAliveTimeout).timeIntervalSinceReferenceDate
|
||||
self.parserConnector?.responseComplete()
|
||||
} else {
|
||||
self.parserConnector?.closeWriter()
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME I do not understand what code written here before was meant to do
|
||||
// If it was about delayed closure invocation then it couldn't work either
|
||||
// Here is the equivalent code
|
||||
closeAfter()
|
||||
completion(.ok)
|
||||
}
|
||||
|
||||
public func abort() {
|
||||
fatalError("abort called, not sure what to do with it")
|
||||
}
|
||||
|
||||
deinit {
|
||||
httpParser.data = nil
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// Protocol implemented by the thing that sits in between us and the network layer
|
||||
/// :nodoc:
|
||||
public protocol ParserConnecting: class {
|
||||
|
||||
/// Send data to the network do be written to the client
|
||||
func queueSocketWrite(_ from: Data) -> Void
|
||||
|
||||
/// Let the network know that a response has started to avoid closing a connection during a slow write
|
||||
func responseBeginning() -> Void
|
||||
|
||||
/// Let the network know that a response is complete, so it can be closed after timeout
|
||||
func responseComplete() -> Void
|
||||
|
||||
/// Used to let the network know we're ready to close the connection
|
||||
func closeWriter() -> Void
|
||||
}
|
||||
|
||||
/// Delegate that can tell us how many connections are in-flight so we can set the Keep-Alive header
|
||||
/// to the correct number of available connections
|
||||
/// :nodoc:
|
||||
public protocol CurrentConnectionCounting: class {
|
||||
/// Current number of active connections
|
||||
var connectionCount: Int { get }
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
/// Version number of the HTTP Protocol
|
||||
public struct HTTPVersion {
|
||||
/// Major version component.
|
||||
public private(set) var major: Int
|
||||
/// Minor version component.
|
||||
public private(set) var minor: Int
|
||||
|
||||
/// Creates an HTTP version.
|
||||
public init(major: Int, minor: Int) {
|
||||
self.major = major
|
||||
self.minor = minor
|
||||
}
|
||||
}
|
||||
|
||||
extension HTTPVersion : Hashable {
|
||||
/// :nodoc:
|
||||
public var hashValue: Int {
|
||||
return (major << 8) | minor
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public static func == (lhs: HTTPVersion, rhs: HTTPVersion) -> Bool {
|
||||
return lhs.major == rhs.major && lhs.minor == rhs.minor
|
||||
}
|
||||
|
||||
/// :nodoc:
|
||||
public static func ~= (match: HTTPVersion, version: HTTPVersion) -> Bool {
|
||||
return match == version
|
||||
}
|
||||
}
|
||||
|
||||
extension HTTPVersion : Comparable {
|
||||
/// :nodoc:
|
||||
public static func < (lhs: HTTPVersion, rhs: HTTPVersion) -> Bool {
|
||||
if lhs.major != rhs.major {
|
||||
return lhs.major < rhs.major
|
||||
} else {
|
||||
return lhs.minor < rhs.minor
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension HTTPVersion : CustomStringConvertible {
|
||||
/// :nodoc:
|
||||
public var description: String {
|
||||
return "HTTP/" + major.description + "." + minor.description
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -152,9 +158,9 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FV4HTTP11HTTPHeaderscFt17dictionaryLiteralGSaTVS0_4NameSS___S0_"></a>
|
||||
<a name="/s:4HTTP11HTTPHeadersVACSayAC4NameV_SStG17dictionaryLiterald_tcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(dictionaryLiteral:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FV4HTTP11HTTPHeaderscFt17dictionaryLiteralGSaTVS0_4NameSS___S0_">init(dictionaryLiteral:)</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPHeadersVACSayAC4NameV_SStG17dictionaryLiterald_tcfc">init(dictionaryLiteral:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -183,9 +189,9 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FV4HTTP11HTTPHeaders6appendFVS0_7LiteralT_"></a>
|
||||
<a name="/s:4HTTP11HTTPHeadersV6appendyAC7LiteralVF"></a>
|
||||
<a name="//apple_ref/swift/Method/append(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FV4HTTP11HTTPHeaders6appendFVS0_7LiteralT_">append(_:)</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPHeadersV6appendyAC7LiteralVF">append(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -210,9 +216,9 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FV4HTTP11HTTPHeaders7replaceFVS0_7LiteralT_"></a>
|
||||
<a name="/s:4HTTP11HTTPHeadersV7replaceyAC7LiteralVF"></a>
|
||||
<a name="//apple_ref/swift/Method/replace(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FV4HTTP11HTTPHeaders7replaceFVS0_7LiteralT_">replace(_:)</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPHeadersV7replaceyAC7LiteralVF">replace(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -241,9 +247,9 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:VV4HTTP11HTTPHeaders4Name"></a>
|
||||
<a name="/s:4HTTP11HTTPHeadersV4NameV"></a>
|
||||
<a name="//apple_ref/swift/Struct/Name" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:VV4HTTP11HTTPHeaders4Name">Name</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPHeadersV4NameV">Name</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -259,7 +265,7 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Name</span> <span class="p">:</span> <span class="kt">Hashable</span><span class="p">,</span> <span class="kt">ExpressibleByStringLiteral</span><span class="p">,</span> <span class="kt">CustomStringConvertible</span></code></pre>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Name</span><span class="p">:</span> <span class="kt">Hashable</span><span class="p">,</span> <span class="kt">ExpressibleByStringLiteral</span><span class="p">,</span> <span class="kt">CustomStringConvertible</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -274,7 +280,7 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP10HTTPMethod6methodSS"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6methodSSv"></a>
|
||||
<a name="//apple_ref/swift/Property/method" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP10HTTPMethod6methodSS">method</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6methodSSv">method</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -172,9 +178,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FV4HTTP10HTTPMethodcFSSS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodVACSScfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FV4HTTP10HTTPMethodcFSSS0_">init(_:)</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodVACSScfc">init(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -203,9 +209,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6deleteS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6deleteACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/delete" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6deleteS0_">delete</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6deleteACvZ">delete</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -230,9 +236,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod3getS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV3getACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/get" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod3getS0_">get</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV3getACvZ">get</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -257,9 +263,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4headS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4headACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/head" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4headS0_">head</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4headACvZ">head</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -284,9 +290,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4postS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4postACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/post" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4postS0_">post</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4postACvZ">post</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -311,9 +317,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod3putS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV3putACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/put" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod3putS0_">put</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV3putACvZ">put</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -338,9 +344,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod7connectS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV7connectACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/connect" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod7connectS0_">connect</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV7connectACvZ">connect</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -365,9 +371,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod7optionsS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV7optionsACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/options" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod7optionsS0_">options</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV7optionsACvZ">options</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -392,9 +398,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod5traceS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV5traceACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/trace" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod5traceS0_">trace</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV5traceACvZ">trace</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -419,9 +425,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4copyS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4copyACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/copy" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4copyS0_">copy</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4copyACvZ">copy</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -446,9 +452,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4lockS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4lockACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/lock" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4lockS0_">lock</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4lockACvZ">lock</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -473,9 +479,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4mkolS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4mkolACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/mkol" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4mkolS0_">mkol</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4mkolACvZ">mkol</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -500,9 +506,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4moveS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4moveACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/move" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4moveS0_">move</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4moveACvZ">move</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -527,9 +533,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod8propfindS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV8propfindACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/propfind" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod8propfindS0_">propfind</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV8propfindACvZ">propfind</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -554,9 +560,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod9proppatchS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV9proppatchACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/proppatch" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod9proppatchS0_">proppatch</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV9proppatchACvZ">proppatch</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -581,9 +587,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6searchS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6searchACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/search" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6searchS0_">search</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6searchACvZ">search</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -608,9 +614,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6unlockS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6unlockACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unlock" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6unlockS0_">unlock</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6unlockACvZ">unlock</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -635,9 +641,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4bindS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4bindACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/bind" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4bindS0_">bind</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4bindACvZ">bind</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -662,9 +668,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6rebindS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6rebindACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/rebind" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6rebindS0_">rebind</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6rebindACvZ">rebind</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -689,9 +695,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6unbindS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6unbindACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unbind" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6unbindS0_">unbind</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6unbindACvZ">unbind</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -716,9 +722,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod3aclS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV3aclACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/acl" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod3aclS0_">acl</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV3aclACvZ">acl</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -743,9 +749,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6reportS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6reportACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/report" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6reportS0_">report</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6reportACvZ">report</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -770,9 +776,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod10mkactivityS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV10mkactivityACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/mkactivity" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod10mkactivityS0_">mkactivity</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV10mkactivityACvZ">mkactivity</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -797,9 +803,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod8checkoutS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV8checkoutACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/checkout" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod8checkoutS0_">checkout</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV8checkoutACvZ">checkout</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -824,9 +830,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod5mergeS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV5mergeACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/merge" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod5mergeS0_">merge</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV5mergeACvZ">merge</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -851,9 +857,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod7msearchS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV7msearchACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/msearch" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod7msearchS0_">msearch</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV7msearchACvZ">msearch</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -878,9 +884,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6notifyS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6notifyACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/notify" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6notifyS0_">notify</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6notifyACvZ">notify</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -905,9 +911,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod9subscribeS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV9subscribeACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/subscribe" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod9subscribeS0_">subscribe</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV9subscribeACvZ">subscribe</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -932,9 +938,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod11unsubscribeS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV11unsubscribeACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unsubscribe" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod11unsubscribeS0_">unsubscribe</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV11unsubscribeACvZ">unsubscribe</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -959,9 +965,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod5patchS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV5patchACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/patch" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod5patchS0_">patch</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV5patchACvZ">patch</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -986,9 +992,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod5purgeS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV5purgeACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/purge" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod5purgeS0_">purge</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV5purgeACvZ">purge</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1013,9 +1019,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod10mkcalendarS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV10mkcalendarACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/mkcalendar" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod10mkcalendarS0_">mkcalendar</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV10mkcalendarACvZ">mkcalendar</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1040,9 +1046,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4linkS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4linkACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/link" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4linkS0_">link</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4linkACvZ">link</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1067,9 +1073,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6unlinkS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6unlinkACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unlink" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6unlinkS0_">unlink</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6unlinkACvZ">unlink</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1098,9 +1104,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vPs8Hashable9hashValueSi"></a>
|
||||
<a name="/s:s8HashableP9hashValueSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/hashValue" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vPs8Hashable9hashValueSi">hashValue</a>
|
||||
<a class="token" href="#/s:s8HashableP9hashValueSiv">hashValue</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1129,7 +1135,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP11HTTPRequest6methodVS_10HTTPMethod"></a>
|
||||
<a name="/s:4HTTP11HTTPRequestV6methodAA10HTTPMethodVv"></a>
|
||||
<a name="//apple_ref/swift/Property/method" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP11HTTPRequest6methodVS_10HTTPMethod">method</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPRequestV6methodAA10HTTPMethodVv">method</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -172,9 +178,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP11HTTPRequest6targetSS"></a>
|
||||
<a name="/s:4HTTP11HTTPRequestV6targetSSv"></a>
|
||||
<a name="//apple_ref/swift/Property/target" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP11HTTPRequest6targetSS">target</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPRequestV6targetSSv">target</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -199,9 +205,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP11HTTPRequest11httpVersionVS_11HTTPVersion"></a>
|
||||
<a name="/s:4HTTP11HTTPRequestV11httpVersionAA11HTTPVersionVv"></a>
|
||||
<a name="//apple_ref/swift/Property/httpVersion" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP11HTTPRequest11httpVersionVS_11HTTPVersion">httpVersion</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPRequestV11httpVersionAA11HTTPVersionVv">httpVersion</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -226,9 +232,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP11HTTPRequest7headersVS_11HTTPHeaders"></a>
|
||||
<a name="/s:4HTTP11HTTPRequestV7headersAA11HTTPHeadersVv"></a>
|
||||
<a name="//apple_ref/swift/Property/headers" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP11HTTPRequest7headersVS_11HTTPHeaders">headers</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPRequestV7headersAA11HTTPHeadersVv">headers</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -258,7 +264,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP12HTTPResponse11httpVersionVS_11HTTPVersion"></a>
|
||||
<a name="/s:4HTTP12HTTPResponseV11httpVersionAA11HTTPVersionVv"></a>
|
||||
<a name="//apple_ref/swift/Property/httpVersion" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP12HTTPResponse11httpVersionVS_11HTTPVersion">httpVersion</a>
|
||||
<a class="token" href="#/s:4HTTP12HTTPResponseV11httpVersionAA11HTTPVersionVv">httpVersion</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -162,7 +168,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">httpVersion</span> <span class="p">:</span> <span class="kt"><a href="../Structs/HTTPVersion.html">HTTPVersion</a></span></code></pre>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">httpVersion</span><span class="p">:</span> <span class="kt"><a href="../Structs/HTTPVersion.html">HTTPVersion</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -172,9 +178,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP12HTTPResponse6statusVS_18HTTPResponseStatus"></a>
|
||||
<a name="/s:4HTTP12HTTPResponseV6statusAA0B6StatusVv"></a>
|
||||
<a name="//apple_ref/swift/Property/status" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP12HTTPResponse6statusVS_18HTTPResponseStatus">status</a>
|
||||
<a class="token" href="#/s:4HTTP12HTTPResponseV6statusAA0B6StatusVv">status</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -199,9 +205,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP12HTTPResponse7headersVS_11HTTPHeaders"></a>
|
||||
<a name="/s:4HTTP12HTTPResponseV7headersAA11HTTPHeadersVv"></a>
|
||||
<a name="//apple_ref/swift/Property/headers" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP12HTTPResponse7headersVS_11HTTPHeaders">headers</a>
|
||||
<a class="token" href="#/s:4HTTP12HTTPResponseV7headersAA11HTTPHeadersVv">headers</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -231,7 +237,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -150,9 +156,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP18HTTPResponseStatus4codeSi"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV4codeSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/code" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP18HTTPResponseStatus4codeSi">code</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV4codeSiv">code</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -177,9 +183,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP18HTTPResponseStatus12reasonPhraseSS"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV12reasonPhraseSSv"></a>
|
||||
<a name="//apple_ref/swift/Property/reasonPhrase" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP18HTTPResponseStatus12reasonPhraseSS">reasonPhrase</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV12reasonPhraseSSv">reasonPhrase</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -204,9 +210,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FV4HTTP18HTTPResponseStatuscFT4codeSi12reasonPhraseSS_S0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusVACSi4code_SS12reasonPhrasetcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(code:reasonPhrase:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FV4HTTP18HTTPResponseStatuscFT4codeSi12reasonPhraseSS_S0_">init(code:reasonPhrase:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusVACSi4code_SS12reasonPhrasetcfc">init(code:reasonPhrase:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -262,9 +268,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FV4HTTP18HTTPResponseStatuscFT4codeSi_S0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusVACSi4code_tcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(code:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FV4HTTP18HTTPResponseStatuscFT4codeSi_S0_">init(code:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusVACSi4code_tcfc">init(code:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -309,9 +315,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus8continueS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV8continueACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/continue" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus8continueS0_">continue</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV8continueACvZ">continue</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -336,9 +342,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus18switchingProtocolsS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV18switchingProtocolsACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/switchingProtocols" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus18switchingProtocolsS0_">switchingProtocols</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV18switchingProtocolsACvZ">switchingProtocols</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -363,9 +369,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus2okS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV2okACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/ok" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus2okS0_">ok</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV2okACvZ">ok</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -390,9 +396,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus7createdS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV7createdACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/created" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus7createdS0_">created</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV7createdACvZ">created</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -417,9 +423,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus8acceptedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV8acceptedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/accepted" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus8acceptedS0_">accepted</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV8acceptedACvZ">accepted</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -444,9 +450,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus27nonAuthoritativeInformationS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV27nonAuthoritativeInformationACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/nonAuthoritativeInformation" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus27nonAuthoritativeInformationS0_">nonAuthoritativeInformation</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV27nonAuthoritativeInformationACvZ">nonAuthoritativeInformation</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -471,9 +477,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus9noContentS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV9noContentACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/noContent" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus9noContentS0_">noContent</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV9noContentACvZ">noContent</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -498,9 +504,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus12resetContentS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV12resetContentACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/resetContent" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus12resetContentS0_">resetContent</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV12resetContentACvZ">resetContent</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -525,9 +531,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus14partialContentS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV14partialContentACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/partialContent" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus14partialContentS0_">partialContent</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV14partialContentACvZ">partialContent</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -552,9 +558,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus11multiStatusS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV05multiC0ACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/multiStatus" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus11multiStatusS0_">multiStatus</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV05multiC0ACvZ">multiStatus</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -579,9 +585,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus15alreadyReportedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV15alreadyReportedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/alreadyReported" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus15alreadyReportedS0_">alreadyReported</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV15alreadyReportedACvZ">alreadyReported</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -606,9 +612,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus6imUsedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV6imUsedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/imUsed" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus6imUsedS0_">imUsed</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV6imUsedACvZ">imUsed</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -633,9 +639,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus15multipleChoicesS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV15multipleChoicesACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/multipleChoices" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus15multipleChoicesS0_">multipleChoices</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV15multipleChoicesACvZ">multipleChoices</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -660,9 +666,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus16movedPermanentlyS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV16movedPermanentlyACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/movedPermanently" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus16movedPermanentlyS0_">movedPermanently</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV16movedPermanentlyACvZ">movedPermanently</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -687,9 +693,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus5foundS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5foundACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/found" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus5foundS0_">found</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5foundACvZ">found</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -714,9 +720,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus8seeOtherS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV8seeOtherACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/seeOther" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus8seeOtherS0_">seeOther</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV8seeOtherACvZ">seeOther</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -741,9 +747,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus11notModifiedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV11notModifiedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/notModified" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus11notModifiedS0_">notModified</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV11notModifiedACvZ">notModified</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -768,9 +774,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus8useProxyS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV8useProxyACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/useProxy" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus8useProxyS0_">useProxy</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV8useProxyACvZ">useProxy</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -795,9 +801,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus17temporaryRedirectS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV17temporaryRedirectACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/temporaryRedirect" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus17temporaryRedirectS0_">temporaryRedirect</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV17temporaryRedirectACvZ">temporaryRedirect</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -822,9 +828,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus17permanentRedirectS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV17permanentRedirectACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/permanentRedirect" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus17permanentRedirectS0_">permanentRedirect</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV17permanentRedirectACvZ">permanentRedirect</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -849,9 +855,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus10badRequestS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV10badRequestACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/badRequest" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus10badRequestS0_">badRequest</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV10badRequestACvZ">badRequest</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -876,9 +882,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus12unauthorizedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV12unauthorizedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unauthorized" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus12unauthorizedS0_">unauthorized</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV12unauthorizedACvZ">unauthorized</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -903,9 +909,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus15paymentRequiredS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV15paymentRequiredACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/paymentRequired" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus15paymentRequiredS0_">paymentRequired</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV15paymentRequiredACvZ">paymentRequired</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -930,9 +936,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus9forbiddenS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV9forbiddenACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/forbidden" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus9forbiddenS0_">forbidden</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV9forbiddenACvZ">forbidden</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -957,9 +963,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus8notFoundS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV8notFoundACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/notFound" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus8notFoundS0_">notFound</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV8notFoundACvZ">notFound</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -984,9 +990,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus16methodNotAllowedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV16methodNotAllowedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/methodNotAllowed" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus16methodNotAllowedS0_">methodNotAllowed</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV16methodNotAllowedACvZ">methodNotAllowed</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1011,9 +1017,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus13notAcceptableS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV13notAcceptableACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/notAcceptable" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus13notAcceptableS0_">notAcceptable</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV13notAcceptableACvZ">notAcceptable</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1038,9 +1044,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus27proxyAuthenticationRequiredS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV27proxyAuthenticationRequiredACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/proxyAuthenticationRequired" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus27proxyAuthenticationRequiredS0_">proxyAuthenticationRequired</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV27proxyAuthenticationRequiredACvZ">proxyAuthenticationRequired</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1065,9 +1071,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus14requestTimeoutS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV14requestTimeoutACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/requestTimeout" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus14requestTimeoutS0_">requestTimeout</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV14requestTimeoutACvZ">requestTimeout</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1092,9 +1098,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus8conflictS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV8conflictACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/conflict" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus8conflictS0_">conflict</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV8conflictACvZ">conflict</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1119,9 +1125,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus4goneS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV4goneACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/gone" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus4goneS0_">gone</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV4goneACvZ">gone</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1146,9 +1152,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus14lengthRequiredS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV14lengthRequiredACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/lengthRequired" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus14lengthRequiredS0_">lengthRequired</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV14lengthRequiredACvZ">lengthRequired</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1173,9 +1179,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus18preconditionFailedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV18preconditionFailedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/preconditionFailed" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus18preconditionFailedS0_">preconditionFailed</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV18preconditionFailedACvZ">preconditionFailed</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1200,9 +1206,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus15payloadTooLargeS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV15payloadTooLargeACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/payloadTooLarge" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus15payloadTooLargeS0_">payloadTooLarge</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV15payloadTooLargeACvZ">payloadTooLarge</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1227,9 +1233,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus10uriTooLongS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV10uriTooLongACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/uriTooLong" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus10uriTooLongS0_">uriTooLong</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV10uriTooLongACvZ">uriTooLong</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1254,9 +1260,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus20unsupportedMediaTypeS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV20unsupportedMediaTypeACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unsupportedMediaType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus20unsupportedMediaTypeS0_">unsupportedMediaType</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV20unsupportedMediaTypeACvZ">unsupportedMediaType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1281,9 +1287,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus19rangeNotSatisfiableS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV19rangeNotSatisfiableACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/rangeNotSatisfiable" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus19rangeNotSatisfiableS0_">rangeNotSatisfiable</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV19rangeNotSatisfiableACvZ">rangeNotSatisfiable</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1308,9 +1314,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus17expectationFailedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV17expectationFailedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/expectationFailed" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus17expectationFailedS0_">expectationFailed</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV17expectationFailedACvZ">expectationFailed</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1335,9 +1341,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus18misdirectedRequestS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV18misdirectedRequestACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/misdirectedRequest" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus18misdirectedRequestS0_">misdirectedRequest</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV18misdirectedRequestACvZ">misdirectedRequest</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1362,9 +1368,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus19unprocessableEntityS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV19unprocessableEntityACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unprocessableEntity" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus19unprocessableEntityS0_">unprocessableEntity</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV19unprocessableEntityACvZ">unprocessableEntity</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1389,9 +1395,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus6lockedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV6lockedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/locked" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus6lockedS0_">locked</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV6lockedACvZ">locked</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1416,9 +1422,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus16failedDependencyS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV16failedDependencyACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/failedDependency" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus16failedDependencyS0_">failedDependency</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV16failedDependencyACvZ">failedDependency</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1443,9 +1449,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus15upgradeRequiredS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV15upgradeRequiredACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/upgradeRequired" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus15upgradeRequiredS0_">upgradeRequired</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV15upgradeRequiredACvZ">upgradeRequired</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1470,9 +1476,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus20preconditionRequiredS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV20preconditionRequiredACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/preconditionRequired" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus20preconditionRequiredS0_">preconditionRequired</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV20preconditionRequiredACvZ">preconditionRequired</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1497,9 +1503,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus15tooManyRequestsS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV15tooManyRequestsACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/tooManyRequests" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus15tooManyRequestsS0_">tooManyRequests</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV15tooManyRequestsACvZ">tooManyRequests</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1524,9 +1530,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus27requestHeaderFieldsTooLargeS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV27requestHeaderFieldsTooLargeACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/requestHeaderFieldsTooLarge" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus27requestHeaderFieldsTooLargeS0_">requestHeaderFieldsTooLarge</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV27requestHeaderFieldsTooLargeACvZ">requestHeaderFieldsTooLarge</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1551,9 +1557,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus26unavailableForLegalReasonsS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV26unavailableForLegalReasonsACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unavailableForLegalReasons" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus26unavailableForLegalReasonsS0_">unavailableForLegalReasons</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV26unavailableForLegalReasonsACvZ">unavailableForLegalReasons</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1578,9 +1584,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus19internalServerErrorS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV19internalServerErrorACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/internalServerError" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus19internalServerErrorS0_">internalServerError</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV19internalServerErrorACvZ">internalServerError</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1605,9 +1611,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus14notImplementedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV14notImplementedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/notImplemented" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus14notImplementedS0_">notImplemented</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV14notImplementedACvZ">notImplemented</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1632,9 +1638,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus10badGatewayS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV10badGatewayACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/badGateway" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus10badGatewayS0_">badGateway</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV10badGatewayACvZ">badGateway</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1659,9 +1665,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus18serviceUnavailableS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV18serviceUnavailableACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/serviceUnavailable" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus18serviceUnavailableS0_">serviceUnavailable</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV18serviceUnavailableACvZ">serviceUnavailable</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1686,9 +1692,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus14gatewayTimeoutS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV14gatewayTimeoutACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/gatewayTimeout" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus14gatewayTimeoutS0_">gatewayTimeout</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV14gatewayTimeoutACvZ">gatewayTimeout</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1713,9 +1719,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus23httpVersionNotSupportedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV23httpVersionNotSupportedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/httpVersionNotSupported" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus23httpVersionNotSupportedS0_">httpVersionNotSupported</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV23httpVersionNotSupportedACvZ">httpVersionNotSupported</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1740,9 +1746,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus21variantAlsoNegotiatesS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV21variantAlsoNegotiatesACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/variantAlsoNegotiates" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus21variantAlsoNegotiatesS0_">variantAlsoNegotiates</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV21variantAlsoNegotiatesACvZ">variantAlsoNegotiates</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1767,9 +1773,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus19insufficientStorageS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV19insufficientStorageACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/insufficientStorage" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus19insufficientStorageS0_">insufficientStorage</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV19insufficientStorageACvZ">insufficientStorage</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1794,9 +1800,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus12loopDetectedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV12loopDetectedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/loopDetected" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus12loopDetectedS0_">loopDetected</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV12loopDetectedACvZ">loopDetected</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1821,9 +1827,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus11notExtendedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV11notExtendedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/notExtended" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus11notExtendedS0_">notExtended</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV11notExtendedACvZ">notExtended</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1848,9 +1854,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus29networkAuthenticationRequiredS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV29networkAuthenticationRequiredACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/networkAuthenticationRequired" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus29networkAuthenticationRequiredS0_">networkAuthenticationRequired</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV29networkAuthenticationRequiredACvZ">networkAuthenticationRequired</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1875,9 +1881,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP18HTTPResponseStatus5classOS0_5Class"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5classAC5ClassOv"></a>
|
||||
<a name="//apple_ref/swift/Property/class" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP18HTTPResponseStatus5classOS0_5Class">class</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5classAC5ClassOv">class</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1905,9 +1911,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:OV4HTTP18HTTPResponseStatus5Class"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5ClassO"></a>
|
||||
<a name="//apple_ref/swift/Enum/Class" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:OV4HTTP18HTTPResponseStatus5Class">Class</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5ClassO">Class</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1943,7 +1949,7 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -150,9 +156,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOV4HTTP18HTTPResponseStatus5Class13informationalFMS1_S1_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5ClassO13informationalA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/informational" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOV4HTTP18HTTPResponseStatus5Class13informationalFMS1_S1_">informational</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5ClassO13informationalA2EmF">informational</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -181,9 +187,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOV4HTTP18HTTPResponseStatus5Class10successfulFMS1_S1_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5ClassO10successfulA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/successful" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOV4HTTP18HTTPResponseStatus5Class10successfulFMS1_S1_">successful</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5ClassO10successfulA2EmF">successful</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -212,9 +218,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOV4HTTP18HTTPResponseStatus5Class11redirectionFMS1_S1_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5ClassO11redirectionA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/redirection" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOV4HTTP18HTTPResponseStatus5Class11redirectionFMS1_S1_">redirection</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5ClassO11redirectionA2EmF">redirection</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -243,9 +249,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOV4HTTP18HTTPResponseStatus5Class11clientErrorFMS1_S1_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5ClassO11clientErrorA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/clientError" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOV4HTTP18HTTPResponseStatus5Class11clientErrorFMS1_S1_">clientError</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5ClassO11clientErrorA2EmF">clientError</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -274,9 +280,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOV4HTTP18HTTPResponseStatus5Class11serverErrorFMS1_S1_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5ClassO11serverErrorA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/serverError" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOV4HTTP18HTTPResponseStatus5Class11serverErrorFMS1_S1_">serverError</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5ClassO11serverErrorA2EmF">serverError</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -305,9 +311,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOV4HTTP18HTTPResponseStatus5Class13invalidStatusFMS1_S1_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5ClassO07invalidC0A2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/invalidStatus" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOV4HTTP18HTTPResponseStatus5Class13invalidStatusFMS1_S1_">invalidStatus</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5ClassO07invalidC0A2EmF">invalidStatus</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -337,7 +343,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP11HTTPVersion5majorSi"></a>
|
||||
<a name="/s:4HTTP11HTTPVersionV5majorSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/major" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP11HTTPVersion5majorSi">major</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPVersionV5majorSiv">major</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -172,9 +178,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP11HTTPVersion5minorSi"></a>
|
||||
<a name="/s:4HTTP11HTTPVersionV5minorSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/minor" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP11HTTPVersion5minorSi">minor</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPVersionV5minorSiv">minor</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -199,9 +205,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FV4HTTP11HTTPVersioncFT5majorSi5minorSi_S0_"></a>
|
||||
<a name="/s:4HTTP11HTTPVersionVACSi5major_Si5minortcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(major:minor:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FV4HTTP11HTTPVersioncFT5majorSi5minorSi_S0_">init(major:minor:)</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPVersionVACSi5major_Si5minortcfc">init(major:minor:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -231,7 +237,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -1,32 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import HTTP
|
||||
|
||||
|
||||
/// Simple `WebApp` that just echoes back whatever input it gets
|
||||
class EchoWebApp: WebAppContaining {
|
||||
func serve(req: HTTPRequest, res: HTTPResponseWriter ) -> HTTPBodyProcessing {
|
||||
//Assume the router gave us the right request - at least for now
|
||||
res.writeHeader(status: .ok, headers: ["Transfer-Encoding": "chunked", "X-foo": "bar"])
|
||||
return .processBody { (chunk, stop) in
|
||||
switch chunk {
|
||||
case .chunk(let data, let finishedProcessing):
|
||||
res.writeBody(data) { _ in
|
||||
finishedProcessing()
|
||||
}
|
||||
case .end:
|
||||
res.done()
|
||||
default:
|
||||
stop = true /* don't call us anymore */
|
||||
res.abort()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import HTTP
|
||||
|
||||
/// `HelloWorldWebApp` that sets the keep alive header for XCTest purposes
|
||||
class HelloWorldKeepAliveWebApp: WebAppContaining {
|
||||
func serve(req: HTTPRequest, res: HTTPResponseWriter ) -> HTTPBodyProcessing {
|
||||
//Assume the router gave us the right request - at least for now
|
||||
res.writeHeader(status: .ok, headers: [
|
||||
"Transfer-Encoding": "chunked",
|
||||
"Connection": "Keep-Alive",
|
||||
"Keep-Alive": "timeout=5, max=10",
|
||||
])
|
||||
return .processBody { (chunk, stop) in
|
||||
switch chunk {
|
||||
case .chunk(_, let finishedProcessing):
|
||||
finishedProcessing()
|
||||
case .end:
|
||||
res.writeBody("Hello, World!")
|
||||
res.done()
|
||||
default:
|
||||
stop = true /* don't call us anymore */
|
||||
res.abort()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import HTTP
|
||||
|
||||
/// Simple `WebApp` that prints "Hello, World" as per K&R
|
||||
class HelloWorldWebApp: WebAppContaining {
|
||||
func serve(req: HTTPRequest, res: HTTPResponseWriter ) -> HTTPBodyProcessing {
|
||||
//Assume the router gave us the right request - at least for now
|
||||
res.writeHeader(status: .ok, headers: [.transferEncoding: "chunked", "X-foo": "bar"])
|
||||
return .processBody { (chunk, stop) in
|
||||
switch chunk {
|
||||
case .chunk(_, let finishedProcessing):
|
||||
finishedProcessing()
|
||||
case .end:
|
||||
res.writeBody("Hello, World!")
|
||||
res.done()
|
||||
default:
|
||||
stop = true /* don't call us anymore */
|
||||
res.abort()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import HTTP
|
||||
|
||||
/// Simple `WebApp` that returns 200: OK without a body
|
||||
class OkWebApp: WebAppContaining {
|
||||
func serve(req: HTTPRequest, res: HTTPResponseWriter ) -> HTTPBodyProcessing {
|
||||
//Assume the router gave us the right request - at least for now
|
||||
res.writeHeader(status: .ok, headers: ["Transfer-Encoding": "chunked", "X-foo": "bar"])
|
||||
return .discardBody
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
/*
|
||||
|
||||
This file isn't part of the API per se, but it's the easiest way to get started- just supply a completion block.
|
||||
It's also really handy for building up `WebApp`s to use when writing tests.
|
||||
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import HTTP
|
||||
|
||||
/// Simple block-based wrapper to create a `WebApp`. Normally used during XCTests
|
||||
public class SimpleResponseCreator: WebAppContaining {
|
||||
|
||||
public struct Response {
|
||||
public let status: HTTPResponseStatus
|
||||
public let headers: HTTPHeaders
|
||||
public let body: Data
|
||||
}
|
||||
|
||||
typealias SimpleHandlerBlock = (_ req: HTTPRequest, _ body: Data) -> Response
|
||||
let completionHandler: SimpleHandlerBlock
|
||||
|
||||
public init(completionHandler:@escaping (_ req: HTTPRequest, _ body: Data) -> Response) {
|
||||
self.completionHandler = completionHandler
|
||||
}
|
||||
|
||||
var buffer = Data()
|
||||
|
||||
public func serve(req: HTTPRequest, res: HTTPResponseWriter ) -> HTTPBodyProcessing {
|
||||
return .processBody { (chunk, stop) in
|
||||
switch chunk {
|
||||
case .chunk(let data, let finishedProcessing):
|
||||
if (data.count > 0) {
|
||||
self.buffer.append(Data(data))
|
||||
}
|
||||
finishedProcessing()
|
||||
case .end:
|
||||
let response = self.completionHandler(req, self.buffer)
|
||||
var headers = response.headers
|
||||
headers.replace([.transferEncoding: "chunked"])
|
||||
res.writeHeader(status: response.status, headers: headers)
|
||||
res.writeBody(response.body) { _ in
|
||||
res.done()
|
||||
}
|
||||
default:
|
||||
stop = true /* don't call us anymore */
|
||||
res.abort()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Dispatch
|
||||
import HTTP
|
||||
|
||||
/// Acts as a fake/mock `HTTPServer` so we can write XCTests without having to worry about Sockets and such
|
||||
class TestResponseResolver: HTTPResponseWriter {
|
||||
let request: HTTPRequest
|
||||
let requestBody: DispatchData
|
||||
|
||||
var response: (status: HTTPResponseStatus, headers: HTTPHeaders)?
|
||||
var responseBody: HTTPResponseBody?
|
||||
|
||||
|
||||
init(request: HTTPRequest, requestBody: Data) {
|
||||
self.request = request
|
||||
self.requestBody = requestBody.withUnsafeBytes { (ptr: UnsafePointer<UInt8>) -> DispatchData in
|
||||
DispatchData(bytes: UnsafeBufferPointer<UInt8>(start: ptr, count: requestBody.count))
|
||||
}
|
||||
}
|
||||
|
||||
func resolveHandler(_ handler:WebApp) {
|
||||
let chunkHandler = handler(request, self)
|
||||
var stop=false
|
||||
var finished=false
|
||||
while !stop && !finished {
|
||||
switch chunkHandler {
|
||||
case .processBody(let handler):
|
||||
handler(.chunk(data: self.requestBody, finishedProcessing: {
|
||||
finished=true
|
||||
}), &stop)
|
||||
handler(.end, &stop)
|
||||
case .discardBody:
|
||||
finished=true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func writeHeader(status: HTTPResponseStatus, headers: HTTPHeaders, completion: @escaping (Result) -> Void) {
|
||||
self.response = (status: status, headers: headers)
|
||||
completion(.ok)
|
||||
}
|
||||
|
||||
func writeTrailer(_ trailers: HTTPHeaders, completion: @escaping (Result) -> Void) {
|
||||
fatalError("Not implemented")
|
||||
}
|
||||
|
||||
func writeBody(_ data: UnsafeHTTPResponseBody, completion: @escaping (Result) -> Void) {
|
||||
if let data = data as? HTTPResponseBody {
|
||||
self.responseBody = data
|
||||
} else {
|
||||
self.responseBody = data.withUnsafeBytes { Data($0) }
|
||||
}
|
||||
completion(.ok)
|
||||
}
|
||||
|
||||
func done(completion: @escaping (Result) -> Void) {
|
||||
completion(.ok)
|
||||
}
|
||||
func done() /* convenience */ {
|
||||
done() { _ in
|
||||
}
|
||||
}
|
||||
|
||||
func abort() {
|
||||
fatalError("abort called, not sure what to do with it")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,350 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
@testable import HTTP
|
||||
@testable import BlueSocketHTTP
|
||||
|
||||
class ServerTests: XCTestCase {
|
||||
func testResponseOK() {
|
||||
let request = HTTPRequest(method: .get, target:"/echo", httpVersion: HTTPVersion(major: 1, minor: 1), headers: ["X-foo": "bar"])
|
||||
let resolver = TestResponseResolver(request: request, requestBody: Data())
|
||||
resolver.resolveHandler(EchoWebApp().serve)
|
||||
XCTAssertNotNil(resolver.response)
|
||||
XCTAssertNotNil(resolver.responseBody)
|
||||
XCTAssertEqual(HTTPResponseStatus.ok.code, resolver.response?.status.code ?? 0)
|
||||
}
|
||||
|
||||
func testEcho() {
|
||||
let testString="This is a test"
|
||||
let request = HTTPRequest(method: .post, target:"/echo", httpVersion: HTTPVersion(major: 1, minor: 1), headers: ["X-foo": "bar"])
|
||||
let resolver = TestResponseResolver(request: request, requestBody: testString.data(using: .utf8)!)
|
||||
resolver.resolveHandler(EchoWebApp().serve)
|
||||
XCTAssertNotNil(resolver.response)
|
||||
XCTAssertNotNil(resolver.responseBody)
|
||||
XCTAssertEqual(HTTPResponseStatus.ok.code, resolver.response?.status.code ?? 0)
|
||||
XCTAssertEqual(testString, resolver.responseBody?.withUnsafeBytes { String(bytes: $0, encoding: .utf8) } ?? "Nil")
|
||||
}
|
||||
|
||||
func testHello() {
|
||||
let request = HTTPRequest(method: .get, target:"/helloworld", httpVersion: HTTPVersion(major: 1, minor: 1), headers: ["X-foo": "bar"])
|
||||
let resolver = TestResponseResolver(request: request, requestBody: Data())
|
||||
resolver.resolveHandler(HelloWorldWebApp().serve)
|
||||
XCTAssertNotNil(resolver.response)
|
||||
XCTAssertNotNil(resolver.responseBody)
|
||||
XCTAssertEqual(HTTPResponseStatus.ok.code, resolver.response?.status.code ?? 0)
|
||||
XCTAssertEqual("Hello, World!", resolver.responseBody?.withUnsafeBytes { String(bytes: $0, encoding: .utf8) } ?? "Nil")
|
||||
}
|
||||
|
||||
func testSimpleHello() {
|
||||
let request = HTTPRequest(method: .get, target:"/helloworld", httpVersion: HTTPVersion(major: 1, minor: 1), headers: ["X-foo": "bar"])
|
||||
let resolver = TestResponseResolver(request: request, requestBody: Data())
|
||||
let simpleHelloWebApp = SimpleResponseCreator { (request, body) -> SimpleResponseCreator.Response in
|
||||
return SimpleResponseCreator.Response(
|
||||
status: .ok,
|
||||
headers: ["X-foo": "bar"],
|
||||
body: "Hello, World!".data(using: .utf8)!
|
||||
)
|
||||
|
||||
}
|
||||
resolver.resolveHandler(simpleHelloWebApp.serve)
|
||||
XCTAssertNotNil(resolver.response)
|
||||
XCTAssertNotNil(resolver.responseBody)
|
||||
XCTAssertEqual(HTTPResponseStatus.ok.code, resolver.response?.status.code ?? 0)
|
||||
XCTAssertEqual("Hello, World!", resolver.responseBody?.withUnsafeBytes { String(bytes: $0, encoding: .utf8) } ?? "Nil")
|
||||
}
|
||||
|
||||
func testOkEndToEnd() {
|
||||
let receivedExpectation = self.expectation(description: "Received web response \(#function)")
|
||||
|
||||
let server = BlueSocketSimpleServer()
|
||||
do {
|
||||
try server.start(port: 0, webapp: OkWebApp().serve)
|
||||
let session = URLSession(configuration: URLSessionConfiguration.default)
|
||||
let url = URL(string: "http://localhost:\(server.port)/")!
|
||||
print("Test \(#function) on port \(server.port)")
|
||||
let dataTask = session.dataTask(with: url) { (responseBody, rawResponse, error) in
|
||||
let response = rawResponse as? HTTPURLResponse
|
||||
XCTAssertNil(error, "\(error!.localizedDescription)")
|
||||
XCTAssertNotNil(response)
|
||||
XCTAssertNotNil(responseBody)
|
||||
XCTAssertEqual(Int(HTTPResponseStatus.ok.code), response?.statusCode ?? 0)
|
||||
receivedExpectation.fulfill()
|
||||
}
|
||||
dataTask.resume()
|
||||
self.waitForExpectations(timeout: 10) { (error) in
|
||||
if let error = error {
|
||||
XCTFail("\(error)")
|
||||
}
|
||||
}
|
||||
server.stop()
|
||||
} catch {
|
||||
XCTFail("Error listening on port \(0): \(error). Use server.failed(callback:) to handle")
|
||||
}
|
||||
}
|
||||
|
||||
func testHelloEndToEnd() {
|
||||
let receivedExpectation = self.expectation(description: "Received web response \(#function)")
|
||||
|
||||
let server = BlueSocketSimpleServer()
|
||||
do {
|
||||
try server.start(port: 0, webapp: HelloWorldWebApp().serve)
|
||||
let session = URLSession(configuration: URLSessionConfiguration.default)
|
||||
let url = URL(string: "http://localhost:\(server.port)/helloworld")!
|
||||
print("Test \(#function) on port \(server.port)")
|
||||
let dataTask = session.dataTask(with: url) { (responseBody, rawResponse, error) in
|
||||
let response = rawResponse as? HTTPURLResponse
|
||||
XCTAssertNil(error, "\(error!.localizedDescription)")
|
||||
XCTAssertNotNil(response)
|
||||
XCTAssertNotNil(responseBody)
|
||||
XCTAssertEqual(Int(HTTPResponseStatus.ok.code), response?.statusCode ?? 0)
|
||||
XCTAssertEqual("Hello, World!", String(data: responseBody ?? Data(), encoding: .utf8) ?? "Nil")
|
||||
receivedExpectation.fulfill()
|
||||
}
|
||||
dataTask.resume()
|
||||
self.waitForExpectations(timeout: 10) { (error) in
|
||||
if let error = error {
|
||||
XCTFail("\(error)")
|
||||
}
|
||||
}
|
||||
server.stop()
|
||||
} catch {
|
||||
XCTFail("Error listening on port \(0): \(error). Use server.failed(callback:) to handle")
|
||||
}
|
||||
}
|
||||
|
||||
func testSimpleHelloEndToEnd() {
|
||||
let receivedExpectation = self.expectation(description: "Received web response \(#function)")
|
||||
let simpleHelloWebApp = SimpleResponseCreator { (request, body) -> SimpleResponseCreator.Response in
|
||||
return SimpleResponseCreator.Response(
|
||||
status: .ok,
|
||||
headers: ["X-foo": "bar"],
|
||||
body: "Hello, World!".data(using: .utf8)!
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
let server = BlueSocketSimpleServer()
|
||||
do {
|
||||
try server.start(port: 0, webapp: simpleHelloWebApp.serve)
|
||||
} catch {
|
||||
XCTFail("Error listening on port \(0): \(error). Use server.failed(callback:) to handle")
|
||||
}
|
||||
|
||||
let session = URLSession(configuration: URLSessionConfiguration.default)
|
||||
let url = URL(string: "http://localhost:\(server.port)/helloworld")!
|
||||
print("Test \(#function) on port \(server.port)")
|
||||
let dataTask = session.dataTask(with: url) { (responseBody, rawResponse, error) in
|
||||
print("\(#function) dataTask returned")
|
||||
let response = rawResponse as? HTTPURLResponse
|
||||
XCTAssertNil(error, "\(error!.localizedDescription)")
|
||||
XCTAssertNotNil(response)
|
||||
XCTAssertNotNil(responseBody)
|
||||
XCTAssertEqual(Int(HTTPResponseStatus.ok.code), response?.statusCode ?? 0)
|
||||
let responseString = String(data: responseBody ?? Data(), encoding: .utf8) ?? "Nil"
|
||||
XCTAssertEqual("Hello, World!", responseString)
|
||||
print("\(#function) fulfilling expectation")
|
||||
receivedExpectation.fulfill()
|
||||
}
|
||||
dataTask.resume()
|
||||
self.waitForExpectations(timeout: 10) { (error) in
|
||||
if let error = error {
|
||||
XCTFail("\(error)")
|
||||
}
|
||||
}
|
||||
server.stop()
|
||||
print("\(#function) stopping server")
|
||||
}
|
||||
|
||||
|
||||
func testRequestEchoEndToEnd() {
|
||||
let receivedExpectation = self.expectation(description: "Received web response \(#function)")
|
||||
let testString="This is a test"
|
||||
|
||||
let server = BlueSocketSimpleServer()
|
||||
do {
|
||||
try server.start(port: 0, webapp: EchoWebApp().serve)
|
||||
let session = URLSession(configuration: URLSessionConfiguration.default)
|
||||
let url = URL(string: "http://localhost:\(server.port)/echo")!
|
||||
print("Test \(#function) on port \(server.port)")
|
||||
var request = URLRequest(url: url)
|
||||
request.httpMethod = "POST"
|
||||
request.httpBody = testString.data(using: .utf8)
|
||||
request.setValue("text/plain", forHTTPHeaderField: "Content-Type")
|
||||
|
||||
let dataTask = session.dataTask(with: request) { (responseBody, rawResponse, error) in
|
||||
let response = rawResponse as? HTTPURLResponse
|
||||
XCTAssertNil(error, "\(error!.localizedDescription)")
|
||||
XCTAssertNotNil(response)
|
||||
XCTAssertNotNil(responseBody)
|
||||
XCTAssertEqual(Int(HTTPResponseStatus.ok.code), response?.statusCode ?? 0)
|
||||
XCTAssertEqual(testString, String(data: responseBody ?? Data(), encoding: .utf8) ?? "Nil")
|
||||
receivedExpectation.fulfill()
|
||||
}
|
||||
dataTask.resume()
|
||||
self.waitForExpectations(timeout: 10) { (error) in
|
||||
if let error = error {
|
||||
XCTFail("\(error)")
|
||||
}
|
||||
}
|
||||
server.stop()
|
||||
} catch {
|
||||
XCTFail("Error listening on port \(0): \(error). Use server.failed(callback:) to handle")
|
||||
}
|
||||
}
|
||||
|
||||
func testRequestKeepAliveEchoEndToEnd() {
|
||||
let receivedExpectation1 = self.expectation(description: "Received web response 1: \(#function)")
|
||||
let receivedExpectation2 = self.expectation(description: "Received web response 2: \(#function)")
|
||||
let receivedExpectation3 = self.expectation(description: "Received web response 3: \(#function)")
|
||||
let testString1="This is a test"
|
||||
let testString2="This is a test, too"
|
||||
let testString3="This is also a test"
|
||||
|
||||
let server = BlueSocketSimpleServer()
|
||||
do {
|
||||
try server.start(port: 0, webapp: EchoWebApp().serve)
|
||||
let session = URLSession(configuration: URLSessionConfiguration.default)
|
||||
let url = URL(string: "http://localhost:\(server.port)/echo")!
|
||||
print("Test \(#function) on port \(server.port)")
|
||||
var request1 = URLRequest(url: url)
|
||||
request1.httpMethod = "POST"
|
||||
request1.httpBody = testString1.data(using: .utf8)
|
||||
request1.setValue("text/plain", forHTTPHeaderField: "Content-Type")
|
||||
|
||||
let dataTask1 = session.dataTask(with: request1) { (responseBody, rawResponse, error) in
|
||||
let response = rawResponse as? HTTPURLResponse
|
||||
XCTAssertNil(error, "\(error!.localizedDescription)")
|
||||
XCTAssertNotNil(response)
|
||||
let headers = response?.allHeaderFields ?? ["":""]
|
||||
let connectionHeader: String = headers["Connection"] as? String ?? ""
|
||||
let keepAliveHeader = headers["Keep-Alive"]
|
||||
XCTAssertEqual(connectionHeader,"Keep-Alive","No Keep-Alive Connection")
|
||||
XCTAssertNotNil(keepAliveHeader)
|
||||
XCTAssertNotNil(responseBody,"No Keep-Alive Header")
|
||||
XCTAssertEqual(server.connectionCount, 1)
|
||||
XCTAssertEqual(Int(HTTPResponseStatus.ok.code), response?.statusCode ?? 0)
|
||||
XCTAssertEqual(testString1, String(data: responseBody ?? Data(), encoding: .utf8) ?? "Nil")
|
||||
var request2 = URLRequest(url: url)
|
||||
request2.httpMethod = "POST"
|
||||
request2.httpBody = testString2.data(using: .utf8)
|
||||
request2.setValue("text/plain", forHTTPHeaderField: "Content-Type")
|
||||
let dataTask2 = session.dataTask(with: request2) { (responseBody2, rawResponse2, error2) in
|
||||
let response2 = rawResponse2 as? HTTPURLResponse
|
||||
XCTAssertNil(error2, "\(error2!.localizedDescription)")
|
||||
XCTAssertNotNil(response2)
|
||||
let headers = response2?.allHeaderFields ?? ["":""]
|
||||
let connectionHeader: String = headers["Connection"] as? String ?? ""
|
||||
let keepAliveHeader = headers["Keep-Alive"]
|
||||
XCTAssertEqual(connectionHeader,"Keep-Alive","No Keep-Alive Connection")
|
||||
XCTAssertNotNil(keepAliveHeader,"No Keep-Alive Header")
|
||||
XCTAssertEqual(server.connectionCount, 1)
|
||||
XCTAssertNotNil(responseBody2)
|
||||
XCTAssertEqual(Int(HTTPResponseStatus.ok.code), response2?.statusCode ?? 0)
|
||||
XCTAssertEqual(testString2, String(data: responseBody2 ?? Data(), encoding: .utf8) ?? "Nil")
|
||||
var request3 = URLRequest(url: url)
|
||||
request3.httpMethod = "POST"
|
||||
request3.httpBody = testString3.data(using: .utf8)
|
||||
request3.setValue("text/plain", forHTTPHeaderField: "Content-Type")
|
||||
let dataTask3 = session.dataTask(with: request3) { (responseBody, rawResponse, error) in
|
||||
let response = rawResponse as? HTTPURLResponse
|
||||
XCTAssertNil(error, "\(error!.localizedDescription)")
|
||||
XCTAssertNotNil(response)
|
||||
let headers = response?.allHeaderFields ?? ["":""]
|
||||
let connectionHeader: String = headers["Connection"] as? String ?? ""
|
||||
let keepAliveHeader = headers["Keep-Alive"]
|
||||
XCTAssertEqual(connectionHeader,"Keep-Alive","No Keep-Alive Connection")
|
||||
XCTAssertNotNil(keepAliveHeader,"No Keep-Alive Header")
|
||||
XCTAssertEqual(server.connectionCount, 1)
|
||||
XCTAssertNotNil(responseBody)
|
||||
XCTAssertEqual(Int(HTTPResponseStatus.ok.code), response?.statusCode ?? 0)
|
||||
XCTAssertEqual(testString3, String(data: responseBody ?? Data(), encoding: .utf8) ?? "Nil")
|
||||
receivedExpectation3.fulfill()
|
||||
}
|
||||
dataTask3.resume()
|
||||
receivedExpectation2.fulfill()
|
||||
}
|
||||
dataTask2.resume()
|
||||
receivedExpectation1.fulfill()
|
||||
}
|
||||
dataTask1.resume()
|
||||
|
||||
self.waitForExpectations(timeout: 10) { (error) in
|
||||
if let error = error {
|
||||
XCTFail("\(error)")
|
||||
}
|
||||
}
|
||||
//server.stop()
|
||||
} catch {
|
||||
XCTFail("Error listening on port \(0): \(error). Use server.failed(callback:) to handle")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func testRequestLargeEchoEndToEnd() {
|
||||
let receivedExpectation = self.expectation(description: "Received web response \(#function)")
|
||||
//Get a file we know exists
|
||||
//let currentDirectoryURL = URL(fileURLWithPath: FileManager.default.currentDirectoryPath)
|
||||
let executableUrl = URL(fileURLWithPath: CommandLine.arguments[0])
|
||||
|
||||
let testExecutableData = try! Data(contentsOf: executableUrl)
|
||||
|
||||
var testDataLong = testExecutableData + testExecutableData + testExecutableData + testExecutableData
|
||||
let length = testDataLong.count
|
||||
let keep = 16385
|
||||
let remove = length - keep
|
||||
if (remove > 0) {
|
||||
testDataLong.removeLast(remove)
|
||||
}
|
||||
|
||||
let testData = Data(testDataLong)
|
||||
|
||||
let server = BlueSocketSimpleServer()
|
||||
do {
|
||||
try server.start(port: 0, webapp: EchoWebApp().serve)
|
||||
let session = URLSession(configuration: URLSessionConfiguration.default)
|
||||
let url = URL(string: "http://localhost:\(server.port)/echo")!
|
||||
print("Test \(#function) on port \(server.port)")
|
||||
var request = URLRequest(url: url)
|
||||
request.httpMethod = "POST"
|
||||
request.httpBody = testData
|
||||
let dataTask = session.dataTask(with: request) { (responseBody, rawResponse, error) in
|
||||
let response = rawResponse as? HTTPURLResponse
|
||||
XCTAssertNil(error, "\(error!.localizedDescription)")
|
||||
XCTAssertNotNil(response)
|
||||
XCTAssertNotNil(responseBody)
|
||||
XCTAssertEqual(Int(HTTPResponseStatus.ok.code), response?.statusCode ?? 0)
|
||||
XCTAssertEqual(testData, responseBody ?? Data())
|
||||
receivedExpectation.fulfill()
|
||||
}
|
||||
dataTask.resume()
|
||||
self.waitForExpectations(timeout: 10) { (error) in
|
||||
if let error = error {
|
||||
XCTFail("\(error)")
|
||||
}
|
||||
}
|
||||
server.stop()
|
||||
} catch {
|
||||
XCTFail("Error listening on port \(0): \(error). Use server.failed(callback:) to handle")
|
||||
}
|
||||
}
|
||||
|
||||
static var allTests = [
|
||||
("testEcho", testEcho),
|
||||
("testHello", testHello),
|
||||
("testSimpleHello", testSimpleHello),
|
||||
("testResponseOK", testResponseOK),
|
||||
("testOkEndToEnd", testOkEndToEnd),
|
||||
("testHelloEndToEnd", testHelloEndToEnd),
|
||||
("testSimpleHelloEndToEnd", testSimpleHelloEndToEnd),
|
||||
("testRequestEchoEndToEnd", testRequestEchoEndToEnd),
|
||||
("testRequestKeepAliveEchoEndToEnd", testRequestKeepAliveEchoEndToEnd),
|
||||
("testRequestLargeEchoEndToEnd", testRequestLargeEchoEndToEnd),
|
||||
]
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
@testable import HTTP
|
||||
|
||||
class HeadersTests: XCTestCase {
|
||||
func testHeaders() {
|
||||
var headers: HTTPHeaders = [
|
||||
.accept: "text/html",
|
||||
"Accept": "application/xhtml+xml",
|
||||
"Accept": "application/xml;q=0.9",
|
||||
"accept": "image/webp",
|
||||
.accept: "*/*;q=0.8",
|
||||
"Accept-Language": "ru-RU,ru;q=0.8",
|
||||
.acceptLanguage: "en-US;q=0.6",
|
||||
"accept-language": "en;q=0.4",
|
||||
"Content-Length": "200",
|
||||
"Set-Cookie": "test1=0; expires=Tue, 21 Jun 2016 16:26:50 GMT; path=/; domain=.my.mail.ru",
|
||||
"Set-Cookie": "test2=0; expires=Tue, 21 Jun 2016 16:26:50 GMT; path=/; domain=.my.mail.ru",
|
||||
]
|
||||
|
||||
XCTAssertEqual(headers["Content-Length"], "200")
|
||||
XCTAssertEqual(headers["content-length"], "200")
|
||||
XCTAssertEqual(headers[.contentLength], "200")
|
||||
XCTAssertEqual(headers[.accept], "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8")
|
||||
XCTAssertEqual(headers[.acceptLanguage], "ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4")
|
||||
XCTAssertEqual(headers[.setCookie], "test1=0; expires=Tue, 21 Jun 2016 16:26:50 GMT; path=/; domain=.my.mail.ru")
|
||||
|
||||
XCTAssertEqual(headers[valuesFor: "Content-Length"], ["200"])
|
||||
XCTAssertEqual(headers[valuesFor: "content-length"], ["200"])
|
||||
XCTAssertEqual(headers[valuesFor: .contentLength], ["200"])
|
||||
XCTAssertEqual(headers[valuesFor: .accept], ["text/html", "application/xhtml+xml", "application/xml;q=0.9", "image/webp", "*/*;q=0.8"])
|
||||
XCTAssertEqual(headers[valuesFor: .setCookie], [
|
||||
"test1=0; expires=Tue, 21 Jun 2016 16:26:50 GMT; path=/; domain=.my.mail.ru",
|
||||
"test2=0; expires=Tue, 21 Jun 2016 16:26:50 GMT; path=/; domain=.my.mail.ru",
|
||||
])
|
||||
|
||||
headers = HTTPHeaders()
|
||||
let initialCount = headers.makeIterator().reduce(0) { (last, element) -> Int in return last + 1 }
|
||||
XCTAssertEqual(0, initialCount)
|
||||
|
||||
headers.append(["Test-Header": "Test Value"])
|
||||
let nextCount = headers.makeIterator().reduce(0) { (last, element) -> Int in return last + 1 }
|
||||
XCTAssertEqual(1, nextCount)
|
||||
|
||||
let testHeaderValueArray = headers[valuesFor: "test-header"]
|
||||
XCTAssertNotNil(testHeaderValueArray)
|
||||
XCTAssertEqual(1,testHeaderValueArray.count)
|
||||
XCTAssertEqual("Test Value",testHeaderValueArray.first ?? "Not Found")
|
||||
|
||||
headers.append(["Test-header": "Test Value 2"])
|
||||
let testHeaderValueArray2 = headers[valuesFor: "test-header"]
|
||||
XCTAssertNotNil(testHeaderValueArray2)
|
||||
XCTAssertEqual(2,testHeaderValueArray2.count)
|
||||
XCTAssertEqual("Test Value",testHeaderValueArray2.first ?? "Not Found")
|
||||
let testHeaderValueArray2Remainder = testHeaderValueArray2.dropFirst()
|
||||
XCTAssertEqual("Test Value 2",testHeaderValueArray2Remainder.first ?? "Not Found")
|
||||
|
||||
//This should overwrites, since the subscript is documented to use lowercase keys
|
||||
headers[valuesFor: "TEST-HEADER"]=["Test Value 3"]
|
||||
let testHeaderValueArray3 = headers[valuesFor: "test-header"]
|
||||
XCTAssertNotNil(testHeaderValueArray3)
|
||||
XCTAssertEqual(1,testHeaderValueArray3.count)
|
||||
|
||||
//Overwrite
|
||||
headers[valuesFor: "TEST-HEADER"]=["Test Value 4a","Test Value 4b"]
|
||||
let testHeaderValueArray4 = headers[valuesFor: "test-header"]
|
||||
XCTAssertNotNil(testHeaderValueArray4)
|
||||
XCTAssertEqual(2,testHeaderValueArray4.count)
|
||||
XCTAssertEqual("Test Value 4a",testHeaderValueArray4.first ?? "Not Found")
|
||||
let testHeaderValueArray4Remainder = testHeaderValueArray4.dropFirst()
|
||||
XCTAssertEqual("Test Value 4b",testHeaderValueArray4Remainder.first ?? "Not Found")
|
||||
}
|
||||
|
||||
static var allTests = [
|
||||
("testHeaders", testHeaders),
|
||||
]
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
@testable import HTTP
|
||||
|
||||
class ResponseTests: XCTestCase {
|
||||
|
||||
func testOkay() {
|
||||
let okay = HTTPResponseStatus.ok
|
||||
XCTAssertEqual(200,okay.code)
|
||||
XCTAssertEqual("OK",okay.reasonPhrase)
|
||||
XCTAssertEqual("\(okay)", "200 OK")
|
||||
}
|
||||
|
||||
func testContinue() {
|
||||
XCTAssertEqual("Continue",HTTPResponseStatus.continue.reasonPhrase)
|
||||
}
|
||||
|
||||
func testNotFound() {
|
||||
XCTAssertEqual(HTTPResponseStatus.notFound, HTTPResponseStatus(code: 404))
|
||||
let notFound: HTTPResponseStatus = 404
|
||||
XCTAssertEqual(notFound, HTTPResponseStatus.notFound)
|
||||
}
|
||||
|
||||
static var allTests = [
|
||||
("testOkay", testOkay),
|
||||
("testContinue", testContinue),
|
||||
("testNotFound", testNotFound),
|
||||
]
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
@testable import HTTP
|
||||
|
||||
class VersionTests: XCTestCase {
|
||||
|
||||
let version10 = HTTPVersion(major: 1, minor: 0)
|
||||
let version11 = HTTPVersion(major: 1, minor: 1)
|
||||
let version20 = HTTPVersion(major: 2, minor: 0)
|
||||
|
||||
func testEquals() {
|
||||
XCTAssertEqual(version10, version10)
|
||||
XCTAssertEqual(version11, version11)
|
||||
XCTAssertEqual(version20, version20)
|
||||
|
||||
XCTAssertNotEqual(version10, version11)
|
||||
XCTAssertNotEqual(version11, version10)
|
||||
XCTAssertNotEqual(version20, version10)
|
||||
XCTAssertNotEqual(version20, version11)
|
||||
}
|
||||
|
||||
func testGreater() {
|
||||
XCTAssertGreaterThan(version11, version10)
|
||||
XCTAssertGreaterThan(version20, version10)
|
||||
XCTAssertGreaterThan(version20, version11)
|
||||
|
||||
XCTAssertGreaterThanOrEqual(version10, version10)
|
||||
XCTAssertGreaterThanOrEqual(version11, version11)
|
||||
XCTAssertGreaterThanOrEqual(version20, version20)
|
||||
|
||||
XCTAssertFalse(version10 > version11)
|
||||
XCTAssertFalse(version10 > version20)
|
||||
XCTAssertFalse(version11 > version20)
|
||||
|
||||
XCTAssertFalse(version10 >= version11)
|
||||
XCTAssertFalse(version10 >= version20)
|
||||
XCTAssertFalse(version11 >= version20)
|
||||
}
|
||||
|
||||
func testLess() {
|
||||
|
||||
XCTAssertLessThan(version10, version11)
|
||||
XCTAssertLessThan(version10, version20)
|
||||
XCTAssertLessThan(version11, version20)
|
||||
|
||||
XCTAssertLessThanOrEqual(version10, version10)
|
||||
XCTAssertLessThanOrEqual(version11, version11)
|
||||
XCTAssertLessThanOrEqual(version20, version20)
|
||||
|
||||
XCTAssertFalse(version11 < version10)
|
||||
XCTAssertFalse(version20 < version10)
|
||||
XCTAssertFalse(version20 < version11)
|
||||
|
||||
XCTAssertFalse(version11 <= version10)
|
||||
XCTAssertFalse(version20 <= version10)
|
||||
XCTAssertFalse(version20 <= version11)
|
||||
}
|
||||
|
||||
static var allTests = [
|
||||
("testEquals", testEquals),
|
||||
("testGreater", testGreater),
|
||||
("testLess", testLess),
|
||||
]
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// This source file is part of the Swift.org Server APIs open source project
|
||||
//
|
||||
// Copyright (c) 2017 Swift Server API project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
//
|
||||
|
||||
import XCTest
|
||||
@testable import HTTPTests
|
||||
@testable import BlueSocketHTTPTests
|
||||
|
||||
XCTMain([
|
||||
// HTTPTests
|
||||
testCase(VersionTests.allTests),
|
||||
testCase(HeadersTests.allTests),
|
||||
testCase(ResponseTests.allTests),
|
||||
|
||||
// BlueSocketHTTPTests
|
||||
testCase(ServerTests.allTests),
|
||||
])
|
||||
|
Before Width: | Height: | Size: 807 B After Width: | Height: | Size: 807 B |
@@ -1,145 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>HTTP Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
<script src="js/lunr.min.js" defer></script>
|
||||
<script src="js/typeahead.jquery.js" defer></script>
|
||||
<script src="js/jazzy.search.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<a title="HTTP Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(100% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col--secondary">
|
||||
<form role="search" action="search.json">
|
||||
<input type="text" placeholder="Search documentation" data-typeahead>
|
||||
</form>
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="index.html">HTTP Reference</a>
|
||||
<img class="carat" src="img/carat.png" />
|
||||
HTTP Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
|
||||
<h1 id='swiftserverhttp' class='heading'>SwiftServerHttp</h1>
|
||||
|
||||
<p>Sample prototype implementation of @weissi’s HTTP Sketch v2 from <a href="https://lists.swift.org/pipermail/swift-server-dev/Week-of-Mon-20170403/000422.html">https://lists.swift.org/pipermail/swift-server-dev/Week-of-Mon-20170403/000422.html</a> for discussion.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -1,145 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>HTTP Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
<script src="js/lunr.min.js" defer></script>
|
||||
<script src="js/typeahead.jquery.js" defer></script>
|
||||
<script src="js/jazzy.search.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<a title="HTTP Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(100% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col--secondary">
|
||||
<form role="search" action="search.json">
|
||||
<input type="text" placeholder="Search documentation" data-typeahead>
|
||||
</form>
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="index.html">HTTP Reference</a>
|
||||
<img class="carat" src="img/carat.png" />
|
||||
HTTP Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
|
||||
<h1 id='swiftserverhttp' class='heading'>SwiftServerHttp</h1>
|
||||
|
||||
<p>Sample prototype implementation of @weissi’s HTTP Sketch v2 from <a href="https://lists.swift.org/pipermail/swift-server-dev/Week-of-Mon-20170403/000422.html">https://lists.swift.org/pipermail/swift-server-dev/Week-of-Mon-20170403/000422.html</a> for discussion.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,417 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>BlueSocketConnectionListener Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Class/BlueSocketConnectionListener" class="dashAnchor"></a>
|
||||
|
||||
<a title="BlueSocketConnectionListener Class Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="../index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(99% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="../index.html">HTTP Reference</a>
|
||||
<img class="carat" src="../img/carat.png" />
|
||||
BlueSocketConnectionListener Class Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Classes.html">Other Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/BlueSocketConnectionListener.html">BlueSocketConnectionListener</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/BlueSocketSimpleServer.html">BlueSocketSimpleServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Extensions.html">Other Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Extensions/UnsafeRawBufferPointer.html">UnsafeRawBufferPointer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Protocols.html">Other Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>BlueSocketConnectionListener</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">BlueSocketConnectionListener</span><span class="p">:</span> <span class="kt">ParserConnecting</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>The Interface between the StreamingParser class and IBM’s BlueSocket wrapper around socket(2).
|
||||
You hopefully should be able to replace this with any network library/engine.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerCAC0C0ADC6socket_AA15StreamingParserC6parserSo13DispatchQueueC04readK0AK05writeK0tcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(socket:parser:readQueue:writeQueue:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerCAC0C0ADC6socket_AA15StreamingParserC6parserSo13DispatchQueueC04readK0AK05writeK0tcfc">init(socket:parser:readQueue:writeQueue:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>initializer</p>
|
||||
|
||||
<ul>
|
||||
<li>Parameters:
|
||||
|
||||
<ul>
|
||||
<li>socket: Socket object from BlueSocket library wrapping a socket(2)</li>
|
||||
<li>parser: Manager of the CHTTPParser library</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">socket</span><span class="p">:</span> <span class="kt">Socket</span><span class="p">,</span> <span class="nv">parser</span><span class="p">:</span> <span class="kt">StreamingParser</span><span class="p">,</span> <span class="nv">readQueue</span><span class="p">:</span> <span class="kt">DispatchQueue</span><span class="p">,</span> <span class="nv">writeQueue</span><span class="p">:</span> <span class="kt">DispatchQueue</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC6isOpenSbv"></a>
|
||||
<a name="//apple_ref/swift/Property/isOpen" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC6isOpenSbv">isOpen</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Check if socket is still open. Used to decide whether it should be closed/pruned after timeout</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isOpen</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC11closeWriteryyF"></a>
|
||||
<a name="//apple_ref/swift/Method/closeWriter()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC11closeWriteryyF">closeWriter()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Called by the parser to let us know that it’s done with this socket</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">closeWriter</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC17responseBeginningyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/responseBeginning()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC17responseBeginningyyF">responseBeginning()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Called by the parser to let us know that a response has started being created</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">responseBeginning</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC16responseCompleteyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/responseComplete()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC16responseCompleteyyF">responseComplete()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Called by the parser to let us know that a response is complete, and we can close after timeout</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">responseComplete</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC7processyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/process()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC7processyyF">process()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Starts reading from the socket and feeding that data to the parser</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">process</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC05queueC5Writey10Foundation4DataVF"></a>
|
||||
<a name="//apple_ref/swift/Method/queueSocketWrite(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC05queueC5Writey10Foundation4DataVF">queueSocketWrite(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Called by the parser to give us data to send back out of the socket</p>
|
||||
|
||||
<div class="aside aside-parameter">
|
||||
<p class="aside-title">Parameter</p>
|
||||
Parameter bytes: Data object to be queued to be written to the socket
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">queueSocketWrite</span><span class="p">(</span><span class="n">_</span> <span class="nv">bytes</span><span class="p">:</span> <span class="kt">Data</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC5writey10Foundation4DataVF"></a>
|
||||
<a name="//apple_ref/swift/Method/write(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC5writey10Foundation4DataVF">write(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Write data to a socket. Should be called in an <code>async</code> block on the <code>socketWriterQueue</code></p>
|
||||
|
||||
<div class="aside aside-parameter">
|
||||
<p class="aside-title">Parameter</p>
|
||||
Parameter data: data to be written
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">write</span><span class="p">(</span><span class="n">_</span> <span class="nv">data</span><span class="p">:</span><span class="kt">Data</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-08-23)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,326 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>BlueSocketSimpleServer Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Class/BlueSocketSimpleServer" class="dashAnchor"></a>
|
||||
|
||||
<a title="BlueSocketSimpleServer Class Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="../index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(99% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="../index.html">HTTP Reference</a>
|
||||
<img class="carat" src="../img/carat.png" />
|
||||
BlueSocketSimpleServer Class Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Classes.html">Other Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/BlueSocketConnectionListener.html">BlueSocketConnectionListener</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/BlueSocketSimpleServer.html">BlueSocketSimpleServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Extensions.html">Other Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Extensions/UnsafeRawBufferPointer.html">UnsafeRawBufferPointer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Protocols.html">Other Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>BlueSocketSimpleServer</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">BlueSocketSimpleServer</span> <span class="p">:</span> <span class="kt">CurrentConnectionCounting</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>An HTTP server that listens for connections on a TCP socket and spawns Listeners to handle them.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP22BlueSocketSimpleServerC4portSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/port" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP22BlueSocketSimpleServerC4portSiv">port</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The port we’re listening on. Used primarily to query a randomly assigned port during XCTests</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">port</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP22BlueSocketSimpleServerCACycfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP22BlueSocketSimpleServerCACycfc">init()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">BlueSocketSimpleServer</span> <span class="p">:</span> <span class="kt">CurrentConnectionCounting</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP22BlueSocketSimpleServerC5startySi4port_Si10queueCountSi06acceptI0AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF"></a>
|
||||
<a name="//apple_ref/swift/Method/start(port:queueCount:acceptCount:handler:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP22BlueSocketSimpleServerC5startySi4port_Si10queueCountSi06acceptI0AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF">start(port:queueCount:acceptCount:handler:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Starts the server listening on a given port</p>
|
||||
|
||||
<p><li>Parameters:</p>
|
||||
|
||||
<p><ul>
|
||||
<li>port: TCP port. See listen(2)</li>
|
||||
<li>handler: Function that creates the HTTP Response from the HTTP Request</li>
|
||||
</ul></li>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
Error (usually a socket error) generated</p>
|
||||
|
||||
<p></div></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">start</span><span class="p">(</span><span class="nv">port</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">queueCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">acceptCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">handler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt"><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></span><span class="p">)</span> <span class="k">throws</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP22BlueSocketSimpleServerC4stopyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/stop()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP22BlueSocketSimpleServerC4stopyyF">stop()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Stop the server and close the sockets</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">stop</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP22BlueSocketSimpleServerC15connectionCountSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/connectionCount" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP22BlueSocketSimpleServerC15connectionCountSiv">connectionCount</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Count the connections - can be used in XCTests</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">connectionCount</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-08-23)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,301 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>HTTPServer Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
<script src="../js/lunr.min.js" defer></script>
|
||||
<script src="../js/typeahead.jquery.js" defer></script>
|
||||
<script src="../js/jazzy.search.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Class/HTTPServer" class="dashAnchor"></a>
|
||||
|
||||
<a title="HTTPServer Class Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="../index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(100% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col--secondary">
|
||||
<form role="search" action="../search.json">
|
||||
<input type="text" placeholder="Search documentation" data-typeahead>
|
||||
</form>
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="../index.html">HTTP Reference</a>
|
||||
<img class="carat" src="../img/carat.png" />
|
||||
HTTPServer Class Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>HTTPServer</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">HTTPServer</span><span class="p">:</span> <span class="kt"><a href="../Protocols/HTTPServing.html">HTTPServing</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>A basic HTTP server. Currently this is implemented using the PoCSocket
|
||||
abstraction, but the intention is to remove this dependency and reimplement
|
||||
the class using transport APIs provided by the Server APIs working group.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP10HTTPServerCACycfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPServerCACycfc">init()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Create an instance of the server. This needs to be followed with a call to <code><a href="../Classes/HTTPServer.html#/s:4HTTP10HTTPServerC5startySi4port_AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF">start(port:handler:)</a></code></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP10HTTPServerC5startySi4port_AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF"></a>
|
||||
<a name="//apple_ref/swift/Method/start(port:handler:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPServerC5startySi4port_AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF">start(port:handler:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Start the HTTP server on the given <code><a href="../Classes/HTTPServer.html#/s:4HTTP10HTTPServerC4portSiv">port</a></code> number, using a <code><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></code> to process incoming requests.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">start</span><span class="p">(</span><span class="nv">port</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">handler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt"><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></span><span class="p">)</span> <span class="k">throws</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP10HTTPServerC4stopyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/stop()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPServerC4stopyyF">stop()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Stop the server</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">stop</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP10HTTPServerC4portSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/port" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPServerC4portSiv">port</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The port number the server is listening on</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">port</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP10HTTPServerC15connectionCountSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/connectionCount" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPServerC15connectionCountSiv">connectionCount</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The number of current connections</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">connectionCount</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP13HTTPBodyChunk5chunkFMS0_FT4dataV8Dispatch12DispatchData18finishedProcessingFT_T__S0_"></a>
|
||||
<a name="/s:4HTTP13HTTPBodyChunkO5chunkAC8Dispatch0E4DataV4data_yyc18finishedProcessingtcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/chunk" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP13HTTPBodyChunk5chunkFMS0_FT4dataV8Dispatch12DispatchData18finishedProcessingFT_T__S0_">chunk</a>
|
||||
<a class="token" href="#/s:4HTTP13HTTPBodyChunkO5chunkAC8Dispatch0E4DataV4data_yyc18finishedProcessingtcACmF">chunk</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -177,9 +183,9 @@ that chunk has been processed.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP13HTTPBodyChunk6failedFMS0_FT5errorPs5Error__S0_"></a>
|
||||
<a name="/s:4HTTP13HTTPBodyChunkO6failedACs5Error_p5error_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/failed" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP13HTTPBodyChunk6failedFMS0_FT5errorPs5Error__S0_">failed</a>
|
||||
<a class="token" href="#/s:4HTTP13HTTPBodyChunkO6failedACs5Error_p5error_tcACmF">failed</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -208,9 +214,9 @@ that chunk has been processed.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP13HTTPBodyChunk7trailerFMS0_FT3keySS5valueSS_S0_"></a>
|
||||
<a name="/s:4HTTP13HTTPBodyChunkO7trailerACSS3key_SS5valuetcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/trailer" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP13HTTPBodyChunk7trailerFMS0_FT3keySS5valueSS_S0_">trailer</a>
|
||||
<a class="token" href="#/s:4HTTP13HTTPBodyChunkO7trailerACSS3key_SS5valuetcACmF">trailer</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -240,9 +246,9 @@ This is currently unimplemented.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP13HTTPBodyChunk3endFMS0_S0_"></a>
|
||||
<a name="/s:4HTTP13HTTPBodyChunkO3endA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/end" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP13HTTPBodyChunk3endFMS0_S0_">end</a>
|
||||
<a class="token" href="#/s:4HTTP13HTTPBodyChunkO3endA2CmF">end</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -272,7 +278,7 @@ This is currently unimplemented.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP18HTTPBodyProcessing11discardBodyFMS0_S0_"></a>
|
||||
<a name="/s:4HTTP18HTTPBodyProcessingO11discardBodyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/discardBody" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP18HTTPBodyProcessing11discardBodyFMS0_S0_">discardBody</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPBodyProcessingO11discardBodyA2CmF">discardBody</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -176,9 +182,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP18HTTPBodyProcessing11processBodyFMS0_FT7handlerFTOS_13HTTPBodyChunkRSb_T__S0_"></a>
|
||||
<a name="/s:4HTTP18HTTPBodyProcessingO11processBodyACyAA0B5ChunkO_Sbztc7handler_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/processBody" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP18HTTPBodyProcessing11processBodyFMS0_FT7handlerFTOS_13HTTPBodyChunkRSb_T__S0_">processBody</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPBodyProcessingO11processBodyACyAA0B5ChunkO_Sbztc7handler_tcACmF">processBody</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -186,14 +192,14 @@
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Used to process the body data associated with the imcoming HTTP request using a <code><a href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a></code></p>
|
||||
<p>Used to process the body data associated with the imcoming HTTP request using a <code><a href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a></code></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">processBody</span><span class="p">(</span><span class="nv">handler</span><span class="p">:</span> <span class="kt"><a href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a></span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">processBody</span><span class="p">(</span><span class="nv">handler</span><span class="p">:</span> <span class="kt"><a href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a></span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -208,7 +214,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP6Result2okFMS0_S0_"></a>
|
||||
<a name="/s:4HTTP6ResultO2okA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/ok" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP6Result2okFMS0_S0_">ok</a>
|
||||
<a class="token" href="#/s:4HTTP6ResultO2okA2CmF">ok</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -176,9 +182,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FO4HTTP6Result5errorFMS0_FPs5Error_S0_"></a>
|
||||
<a name="/s:4HTTP6ResultO5errorACs5Error_pcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/error" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FO4HTTP6Result5errorFMS0_FPs5Error_S0_">error</a>
|
||||
<a class="token" href="#/s:4HTTP6ResultO5errorACs5Error_pcACmF">error</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -208,7 +214,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -0,0 +1,205 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>UnsafeRawBufferPointer Extension Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Extension/UnsafeRawBufferPointer" class="dashAnchor"></a>
|
||||
|
||||
<a title="UnsafeRawBufferPointer Extension Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="../index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(99% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="../index.html">HTTP Reference</a>
|
||||
<img class="carat" src="../img/carat.png" />
|
||||
UnsafeRawBufferPointer Extension Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Classes.html">Other Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/BlueSocketConnectionListener.html">BlueSocketConnectionListener</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/BlueSocketSimpleServer.html">BlueSocketSimpleServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Extensions.html">Other Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Extensions/UnsafeRawBufferPointer.html">UnsafeRawBufferPointer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Protocols.html">Other Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>UnsafeRawBufferPointer</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">struct</span> <span class="kt">UnsafeRawBufferPointer</span> <span class="p">:</span> <span class="kt">Collection</span><span class="p">,</span> <span class="kt">RandomAccessCollection</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:s22UnsafeRawBufferPointerV4HTTPE04withA5BytesxxABKcKlF"></a>
|
||||
<a name="//apple_ref/swift/Method/withUnsafeBytes(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:s22UnsafeRawBufferPointerV4HTTPE04withA5BytesxxABKcKlF">withUnsafeBytes(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">struct</span> <span class="kt">UnsafeRawBufferPointer</span> <span class="p">:</span> <span class="kt">Collection</span><span class="p">,</span> <span class="kt">RandomAccessCollection</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-08-23)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -32,7 +32,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -53,10 +53,16 @@
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -84,7 +90,7 @@
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -137,9 +143,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:V4HTTP11HTTPHeaders"></a>
|
||||
<a name="/s:4HTTP11HTTPHeadersV"></a>
|
||||
<a name="//apple_ref/swift/Struct/HTTPHeaders" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:V4HTTP11HTTPHeaders">HTTPHeaders</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPHeadersV">HTTPHeaders</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -176,9 +182,9 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:V4HTTP11HTTPVersion"></a>
|
||||
<a name="/s:4HTTP11HTTPVersionV"></a>
|
||||
<a name="//apple_ref/swift/Struct/HTTPVersion" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:V4HTTP11HTTPVersion">HTTPVersion</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPVersionV">HTTPVersion</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -209,7 +215,7 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -32,7 +32,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -53,10 +53,16 @@
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -84,7 +90,7 @@
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -137,9 +143,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:V4HTTP11HTTPRequest"></a>
|
||||
<a name="/s:4HTTP11HTTPRequestV"></a>
|
||||
<a name="//apple_ref/swift/Struct/HTTPRequest" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:V4HTTP11HTTPRequest">HTTPRequest</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPRequestV">HTTPRequest</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -165,9 +171,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP15HTTPBodyHandler"></a>
|
||||
<a name="/s:4HTTP15HTTPBodyHandlera"></a>
|
||||
<a name="//apple_ref/swift/Alias/HTTPBodyHandler" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="token" href="#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -175,7 +181,7 @@
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Method that takes a chunk of request body and is expected to write to the ResponseWriter</p>
|
||||
<p>Method that takes a chunk of request body and is expected to write to the <code><a href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a></code></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -210,7 +216,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Bool that can be set to true in order to prevent further processing</p>
|
||||
<p>A boolean flag that can be set to true in order to prevent further processing</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -223,9 +229,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:O4HTTP18HTTPBodyProcessing"></a>
|
||||
<a name="/s:4HTTP18HTTPBodyProcessingO"></a>
|
||||
<a name="//apple_ref/swift/Enum/HTTPBodyProcessing" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:O4HTTP18HTTPBodyProcessing">HTTPBodyProcessing</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPBodyProcessingO">HTTPBodyProcessing</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -251,9 +257,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:O4HTTP13HTTPBodyChunk"></a>
|
||||
<a name="/s:4HTTP13HTTPBodyChunkO"></a>
|
||||
<a name="//apple_ref/swift/Enum/HTTPBodyChunk" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:O4HTTP13HTTPBodyChunk">HTTPBodyChunk</a>
|
||||
<a class="token" href="#/s:4HTTP13HTTPBodyChunkO">HTTPBodyChunk</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -283,9 +289,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:V4HTTP10HTTPMethod"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV"></a>
|
||||
<a name="//apple_ref/swift/Struct/HTTPMethod" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:V4HTTP10HTTPMethod">HTTPMethod</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV">HTTPMethod</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -316,7 +322,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -32,7 +32,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -53,10 +53,16 @@
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -84,7 +90,7 @@
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -137,9 +143,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:V4HTTP12HTTPResponse"></a>
|
||||
<a name="/s:4HTTP12HTTPResponseV"></a>
|
||||
<a name="//apple_ref/swift/Struct/HTTPResponse" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:V4HTTP12HTTPResponse">HTTPResponse</a>
|
||||
<a class="token" href="#/s:4HTTP12HTTPResponseV">HTTPResponse</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -165,9 +171,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:V4HTTP18HTTPResponseStatus"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV"></a>
|
||||
<a name="//apple_ref/swift/Struct/HTTPResponseStatus" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:V4HTTP18HTTPResponseStatus">HTTPResponseStatus</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV">HTTPResponseStatus</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -198,9 +204,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:P4HTTP18HTTPResponseWriter"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterP"></a>
|
||||
<a name="//apple_ref/swift/Protocol/HTTPResponseWriter" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:P4HTTP18HTTPResponseWriter">HTTPResponseWriter</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterP">HTTPResponseWriter</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -231,7 +237,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -32,7 +32,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -53,10 +53,16 @@
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -84,7 +90,7 @@
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -137,9 +143,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:P4HTTP16WebAppContaining"></a>
|
||||
<a name="//apple_ref/swift/Protocol/WebAppContaining" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:P4HTTP16WebAppContaining">WebAppContaining</a>
|
||||
<a name="/s:4HTTP10HTTPServerC"></a>
|
||||
<a name="//apple_ref/swift/Class/HTTPServer" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPServerC">HTTPServer</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -147,35 +153,17 @@
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Class protocol containing the WebApp that responds to the incoming HTTP requests.
|
||||
The following is an example of a WebApp that returns the request as a response:</p>
|
||||
<pre class="highlight swift"><code> <span class="kd">class</span> <span class="kt">EchoWebApp</span><span class="p">:</span> <span class="kt">WebAppContaining</span> <span class="p">{</span>
|
||||
<span class="kd">func</span> <span class="nf">serve</span><span class="p">(</span><span class="nv">req</span><span class="p">:</span> <span class="kt">HTTPRequest</span><span class="p">,</span> <span class="nv">res</span><span class="p">:</span> <span class="kt">HTTPResponseWriter</span> <span class="p">)</span> <span class="o">-></span> <span class="kt">HTTPBodyProcessing</span> <span class="p">{</span>
|
||||
<span class="n">res</span><span class="o">.</span><span class="nf">writeHeader</span><span class="p">(</span><span class="nv">status</span><span class="p">:</span> <span class="o">.</span><span class="n">ok</span><span class="p">,</span> <span class="nv">headers</span><span class="p">:</span> <span class="p">[:])</span>
|
||||
<span class="k">return</span> <span class="o">.</span><span class="n">processBody</span> <span class="p">{</span> <span class="p">(</span><span class="n">chunk</span><span class="p">,</span> <span class="n">stop</span><span class="p">)</span> <span class="k">in</span>
|
||||
<span class="k">switch</span> <span class="n">chunk</span> <span class="p">{</span>
|
||||
<span class="k">case</span> <span class="o">.</span><span class="nf">chunk</span><span class="p">(</span><span class="k">let</span> <span class="nv">data</span><span class="p">,</span> <span class="k">let</span> <span class="nv">finishedProcessing</span><span class="p">):</span>
|
||||
<span class="n">res</span><span class="o">.</span><span class="nf">writeBody</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="p">{</span> <span class="n">_</span> <span class="k">in</span>
|
||||
<span class="nf">finishedProcessing</span><span class="p">()</span>
|
||||
<span class="p">}</span>
|
||||
<span class="k">case</span> <span class="o">.</span><span class="nv">end</span><span class="p">:</span>
|
||||
<span class="n">res</span><span class="o">.</span><span class="nf">done</span><span class="p">()</span>
|
||||
<span class="k">default</span><span class="p">:</span>
|
||||
<span class="n">stop</span> <span class="o">=</span> <span class="kc">true</span>
|
||||
<span class="n">res</span><span class="o">.</span><span class="nf">abort</span><span class="p">()</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
<p>A basic HTTP server. Currently this is implemented using the PoCSocket
|
||||
abstraction, but the intention is to remove this dependency and reimplement
|
||||
the class using transport APIs provided by the Server APIs working group.</p>
|
||||
|
||||
<a href="Protocols/WebAppContaining.html" class="slightly-smaller">See more</a>
|
||||
<a href="Classes/HTTPServer.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">WebAppContaining</span><span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">HTTPServer</span><span class="p">:</span> <span class="kt"><a href="Protocols/HTTPServing.html">HTTPServing</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -185,9 +173,9 @@ The following is an example of a WebApp that returns the request as a response:<
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP6WebApp"></a>
|
||||
<a name="//apple_ref/swift/Alias/WebApp" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a name="/s:4HTTP11HTTPServingP"></a>
|
||||
<a name="//apple_ref/swift/Protocol/HTTPServing" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPServingP">HTTPServing</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -195,14 +183,66 @@ The following is an example of a WebApp that returns the request as a response:<
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Typealias for a closure that handles an incoming HTTP request</p>
|
||||
<p>Definition of an HTTP server.</p>
|
||||
|
||||
<a href="Protocols/HTTPServing.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">HTTPServing</span> <span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP18HTTPRequestHandlera"></a>
|
||||
<a name="//apple_ref/swift/Alias/HTTPRequestHandler" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Typealias for a closure that handles an incoming HTTP request
|
||||
The following is an example of an echo <code>HTTPRequestHandler</code> that returns the request it receives as a response:</p>
|
||||
<pre class="highlight swift"><code> <span class="kd">func</span> <span class="nf">echo</span><span class="p">(</span><span class="nv">request</span><span class="p">:</span> <span class="kt">HTTPRequest</span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt">HTTPResponseWriter</span> <span class="p">)</span> <span class="o">-></span> <span class="kt">HTTPBodyProcessing</span> <span class="p">{</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">writeHeader</span><span class="p">(</span><span class="nv">status</span><span class="p">:</span> <span class="o">.</span><span class="n">ok</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="o">.</span><span class="n">processBody</span> <span class="p">{</span> <span class="p">(</span><span class="n">chunk</span><span class="p">,</span> <span class="n">stop</span><span class="p">)</span> <span class="k">in</span>
|
||||
<span class="k">switch</span> <span class="n">chunk</span> <span class="p">{</span>
|
||||
<span class="k">case</span> <span class="o">.</span><span class="nf">chunk</span><span class="p">(</span><span class="k">let</span> <span class="nv">data</span><span class="p">,</span> <span class="k">let</span> <span class="nv">finishedProcessing</span><span class="p">):</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">writeBody</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="p">{</span> <span class="n">_</span> <span class="k">in</span>
|
||||
<span class="nf">finishedProcessing</span><span class="p">()</span>
|
||||
<span class="p">}</span>
|
||||
<span class="k">case</span> <span class="o">.</span><span class="nv">end</span><span class="p">:</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">done</span><span class="p">()</span>
|
||||
<span class="k">default</span><span class="p">:</span>
|
||||
<span class="n">stop</span> <span class="o">=</span> <span class="kc">true</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">abort</span><span class="p">()</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
|
||||
<p>This then needs to be registered with the server using <code><a href="Classes/HTTPServer.html#/s:4HTTP10HTTPServerC5startySi4port_AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF">HTTPServer.start(port:handler:)</a></code></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">WebApp</span> <span class="o">=</span> <span class="p">(</span><span class="kt"><a href="Structs/HTTPRequest.html">HTTPRequest</a></span><span class="p">,</span> <span class="kt"><a href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a></span><span class="p">)</span> <span class="o">-></span> <span class="kt"><a href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a></span></code></pre>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">HTTPRequestHandler</span> <span class="o">=</span> <span class="p">(</span><span class="kt"><a href="Structs/HTTPRequest.html">HTTPRequest</a></span><span class="p">,</span> <span class="kt"><a href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a></span><span class="p">)</span> <span class="o">-></span> <span class="kt"><a href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -240,6 +280,39 @@ The following is an example of a WebApp that returns the request as a response:<
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP19HTTPRequestHandlingP"></a>
|
||||
<a name="//apple_ref/swift/Protocol/HTTPRequestHandling" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP19HTTPRequestHandlingP">HTTPRequestHandling</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Class protocol containing a <code>handle()</code> function that implements <code><a href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></code> to respond to incoming HTTP requests.</p>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></code> for more information
|
||||
|
||||
</div>
|
||||
|
||||
<a href="Protocols/HTTPRequestHandling.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">HTTPRequestHandling</span><span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -248,7 +321,7 @@ The following is an example of a WebApp that returns the request as a response:<
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -0,0 +1,274 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Other Classes Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<a title="Other Classes Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(99% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="index.html">HTTP Reference</a>
|
||||
<img class="carat" src="img/carat.png" />
|
||||
Other Classes Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Classes.html">Other Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/BlueSocketConnectionListener.html">BlueSocketConnectionListener</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/BlueSocketSimpleServer.html">BlueSocketSimpleServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Extensions.html">Other Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Extensions/UnsafeRawBufferPointer.html">UnsafeRawBufferPointer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Protocols.html">Other Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>Other Classes</h1>
|
||||
<p>The following classes are available globally.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP10HTTPServerC"></a>
|
||||
<a name="//apple_ref/swift/Class/HTTPServer" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPServerC">HTTPServer</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A basic HTTP server. Currently this is implemented using the BlueSocket
|
||||
abstraction, but the intention is to remove this dependency and reimplement
|
||||
the class using transport APIs provided by the Server APIs working group.</p>
|
||||
|
||||
<a href="Classes/HTTPServer.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">HTTPServer</span> <span class="p">:</span> <span class="kt"><a href="Protocols/HTTPServing.html">HTTPServing</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP28BlueSocketConnectionListenerC"></a>
|
||||
<a name="//apple_ref/swift/Class/BlueSocketConnectionListener" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP28BlueSocketConnectionListenerC">BlueSocketConnectionListener</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The Interface between the StreamingParser class and IBM’s BlueSocket wrapper around socket(2).
|
||||
You hopefully should be able to replace this with any network library/engine.</p>
|
||||
|
||||
<a href="Classes/BlueSocketConnectionListener.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">BlueSocketConnectionListener</span><span class="p">:</span> <span class="kt">ParserConnecting</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/Server"></a>
|
||||
<a name="//apple_ref/swift/Section/Server" class="dashAnchor"></a>
|
||||
<a href="#/Server">
|
||||
<h3 class="section-name">Server</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP22BlueSocketSimpleServerC"></a>
|
||||
<a name="//apple_ref/swift/Class/BlueSocketSimpleServer" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP22BlueSocketSimpleServerC">BlueSocketSimpleServer</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An HTTP server that listens for connections on a TCP socket and spawns Listeners to handle them.</p>
|
||||
|
||||
<a href="Classes/BlueSocketSimpleServer.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">BlueSocketSimpleServer</span> <span class="p">:</span> <span class="kt">CurrentConnectionCounting</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-08-23)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -32,7 +32,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -53,10 +53,16 @@
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -84,7 +90,7 @@
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -138,9 +144,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:O4HTTP6Result"></a>
|
||||
<a name="/s:4HTTP6ResultO"></a>
|
||||
<a name="//apple_ref/swift/Enum/Result" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:O4HTTP6Result">Result</a>
|
||||
<a class="token" href="#/s:4HTTP6ResultO">Result</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -171,7 +177,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -0,0 +1,199 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Other Extensions Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<a title="Other Extensions Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(99% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="index.html">HTTP Reference</a>
|
||||
<img class="carat" src="img/carat.png" />
|
||||
Other Extensions Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Classes.html">Other Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/BlueSocketConnectionListener.html">BlueSocketConnectionListener</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/BlueSocketSimpleServer.html">BlueSocketSimpleServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Extensions.html">Other Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Extensions/UnsafeRawBufferPointer.html">UnsafeRawBufferPointer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Protocols.html">Other Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>Other Extensions</h1>
|
||||
<p>The following extensions are available globally.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:s22UnsafeRawBufferPointerV"></a>
|
||||
<a name="//apple_ref/swift/Extension/UnsafeRawBufferPointer" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:s22UnsafeRawBufferPointerV">UnsafeRawBufferPointer</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
|
||||
<a href="Extensions/UnsafeRawBufferPointer.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">struct</span> <span class="kt">UnsafeRawBufferPointer</span> <span class="p">:</span> <span class="kt">Collection</span><span class="p">,</span> <span class="kt">RandomAccessCollection</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-08-23)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,200 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Other Protocols Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<a title="Other Protocols Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(99% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="index.html">HTTP Reference</a>
|
||||
<img class="carat" src="img/carat.png" />
|
||||
Other Protocols Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Classes.html">Other Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/BlueSocketConnectionListener.html">BlueSocketConnectionListener</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/BlueSocketSimpleServer.html">BlueSocketSimpleServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Extensions.html">Other Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Extensions/UnsafeRawBufferPointer.html">UnsafeRawBufferPointer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Protocols.html">Other Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>Other Protocols</h1>
|
||||
<p>The following protocols are available globally.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP11HTTPServingP"></a>
|
||||
<a name="//apple_ref/swift/Protocol/HTTPServing" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPServingP">HTTPServing</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Definition of an HTTP server.</p>
|
||||
|
||||
<a href="Protocols/HTTPServing.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">HTTPServing</span> <span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-08-23)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,232 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>HTTPRequestHandling Protocol Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
<script src="../js/lunr.min.js" defer></script>
|
||||
<script src="../js/typeahead.jquery.js" defer></script>
|
||||
<script src="../js/jazzy.search.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Protocol/HTTPRequestHandling" class="dashAnchor"></a>
|
||||
|
||||
<a title="HTTPRequestHandling Protocol Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="../index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(100% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col--secondary">
|
||||
<form role="search" action="../search.json">
|
||||
<input type="text" placeholder="Search documentation" data-typeahead>
|
||||
</form>
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="../index.html">HTTP Reference</a>
|
||||
<img class="carat" src="../img/carat.png" />
|
||||
HTTPRequestHandling Protocol Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>HTTPRequestHandling</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">HTTPRequestHandling</span><span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Class protocol containing a <code>handle()</code> function that implements <code><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></code> to respond to incoming HTTP requests.</p>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></code> for more information
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP19HTTPRequestHandlingP6handleAA18HTTPBodyProcessingOAA0B0V7request_AA18HTTPResponseWriter_p8responsetF"></a>
|
||||
<a name="//apple_ref/swift/Method/handle(request:response:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP19HTTPRequestHandlingP6handleAA18HTTPBodyProcessingOAA0B0V7request_AA18HTTPResponseWriter_p8responsetF">handle(request:response:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>handle: function that implements <code><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></code> and is called when a new HTTP request is received by the HTTP server.</p>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></code> for more information
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">handle</span><span class="p">(</span><span class="nv">request</span><span class="p">:</span> <span class="kt"><a href="../Structs/HTTPRequest.html">HTTPRequest</a></span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt"><a href="../Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a></span><span class="p">)</span> <span class="o">-></span> <span class="kt"><a href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>request</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>the incoming HTTP request.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>response</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>a writer providing functions to create an HTTP response to the request.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP4HTTP18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus7headersVS_11HTTPHeaders10completionFOS_6ResultT__T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterP11writeHeaderyAA0B6StatusV6status_AA11HTTPHeadersV7headersyAA6ResultOc10completiontF"></a>
|
||||
<a name="//apple_ref/swift/Method/writeHeader(status:headers:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP4HTTP18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus7headersVS_11HTTPHeaders10completionFOS_6ResultT__T_">writeHeader(status:headers:completion:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterP11writeHeaderyAA0B6StatusV6status_AA11HTTPHeadersV7headersyAA6ResultOc10completiontF">writeHeader(status:headers:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -155,7 +161,7 @@
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>writeHeader: Writer function to create the headers for an HTTP response</p>
|
||||
<p>Writer function to create the headers for an HTTP response</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -215,9 +221,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP4HTTP18HTTPResponseWriter12writeTrailerFTVS_11HTTPHeaders10completionFOS_6ResultT__T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterP12writeTraileryAA11HTTPHeadersV_yAA6ResultOc10completiontF"></a>
|
||||
<a name="//apple_ref/swift/Method/writeTrailer(_:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP4HTTP18HTTPResponseWriter12writeTrailerFTVS_11HTTPHeaders10completionFOS_6ResultT__T_">writeTrailer(_:completion:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterP12writeTraileryAA11HTTPHeadersV_yAA6ResultOc10completiontF">writeTrailer(_:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -225,7 +231,7 @@
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>writeTrailer: Writer function to write a trailer header as part of the HTTP response</p>
|
||||
<p>Writer function to write a trailer header as part of the HTTP response</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -274,9 +280,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP4HTTP18HTTPResponseWriter9writeBodyFTPS_22UnsafeHTTPResponseBody_10completionFOS_6ResultT__T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterP9writeBodyyAA06UnsafebE0_p_yAA6ResultOc10completiontF"></a>
|
||||
<a name="//apple_ref/swift/Method/writeBody(_:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP4HTTP18HTTPResponseWriter9writeBodyFTPS_22UnsafeHTTPResponseBody_10completionFOS_6ResultT__T_">writeBody(_:completion:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterP9writeBodyyAA06UnsafebE0_p_yAA6ResultOc10completiontF">writeBody(_:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -284,7 +290,7 @@ This is not currently implemented</p>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>writeBody: Writer function to write data to the body of the HTTP response</p>
|
||||
<p>Writer function to write data to the body of the HTTP response</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -332,9 +338,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP4HTTP18HTTPResponseWriter4doneFT10completionFOS_6ResultT__T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterP4doneyyAA6ResultOc10completion_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/done(completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP4HTTP18HTTPResponseWriter4doneFT10completionFOS_6ResultT__T_">done(completion:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterP4doneyyAA6ResultOc10completion_tF">done(completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -342,7 +348,7 @@ This is not currently implemented</p>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>done: Writer function to complete the HTTP response</p>
|
||||
<p>Writer function to complete the HTTP response</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -378,9 +384,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP4HTTP18HTTPResponseWriter5abortFT_T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterP5abortyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/abort()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP4HTTP18HTTPResponseWriter5abortFT_T_">abort()</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterP5abortyyF">abort()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -409,9 +415,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FE4HTTPPS_18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus7headersVS_11HTTPHeaders_T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterPAAE11writeHeaderyAA0B6StatusV6status_AA11HTTPHeadersV7headerstF"></a>
|
||||
<a name="//apple_ref/swift/Method/writeHeader(status:headers:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4HTTPPS_18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus7headersVS_11HTTPHeaders_T_">writeHeader(status:headers:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterPAAE11writeHeaderyAA0B6StatusV6status_AA11HTTPHeadersV7headerstF">writeHeader(status:headers:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Extension method
|
||||
@@ -422,10 +428,10 @@ This is not currently implemented</p>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Convenience funtion to write the headers for an HTTP response without a completion handler</p>
|
||||
<p>Convenience function to write the headers for an HTTP response without a completion handler</p>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="../Protocols/HTTPResponseWriter.html#/s:FP4HTTP18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus7headersVS_11HTTPHeaders10completionFOS_6ResultT__T_">writeHeader(status:headers:completion:)</a></code>
|
||||
<code><a href="../Protocols/HTTPResponseWriter.html#/s:4HTTP18HTTPResponseWriterP11writeHeaderyAA0B6StatusV6status_AA11HTTPHeadersV7headersyAA6ResultOc10completiontF">writeHeader(status:headers:completion:)</a></code>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -444,9 +450,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FE4HTTPPS_18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus_T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterPAAE11writeHeaderyAA0B6StatusV6status_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/writeHeader(status:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4HTTPPS_18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus_T_">writeHeader(status:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterPAAE11writeHeaderyAA0B6StatusV6status_tF">writeHeader(status:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Extension method
|
||||
@@ -457,10 +463,10 @@ This is not currently implemented</p>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Convenience funtion to write a HTTP response with no headers or completion handler</p>
|
||||
<p>Convenience function to write a HTTP response with no headers or completion handler</p>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="../Protocols/HTTPResponseWriter.html#/s:FP4HTTP18HTTPResponseWriter11writeHeaderFT6statusVS_18HTTPResponseStatus7headersVS_11HTTPHeaders10completionFOS_6ResultT__T_">writeHeader(status:headers:completion:)</a></code>
|
||||
<code><a href="../Protocols/HTTPResponseWriter.html#/s:4HTTP18HTTPResponseWriterP11writeHeaderyAA0B6StatusV6status_AA11HTTPHeadersV7headersyAA6ResultOc10completiontF">writeHeader(status:headers:completion:)</a></code>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -479,9 +485,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FE4HTTPPS_18HTTPResponseWriter12writeTrailerFVS_11HTTPHeadersT_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterPAAE12writeTraileryAA11HTTPHeadersVF"></a>
|
||||
<a name="//apple_ref/swift/Method/writeTrailer(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4HTTPPS_18HTTPResponseWriter12writeTrailerFVS_11HTTPHeadersT_">writeTrailer(_:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterPAAE12writeTraileryAA11HTTPHeadersVF">writeTrailer(_:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Extension method
|
||||
@@ -495,7 +501,7 @@ This is not currently implemented</p>
|
||||
<p>Convenience function to write a trailer header as part of the HTTP response without a completion handler</p>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="../Protocols/HTTPResponseWriter.html#/s:FP4HTTP18HTTPResponseWriter12writeTrailerFTVS_11HTTPHeaders10completionFOS_6ResultT__T_">writeTrailer(_:completion:)</a></code>
|
||||
<code><a href="../Protocols/HTTPResponseWriter.html#/s:4HTTP18HTTPResponseWriterP12writeTraileryAA11HTTPHeadersV_yAA6ResultOc10completiontF">writeTrailer(_:completion:)</a></code>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -514,9 +520,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FE4HTTPPS_18HTTPResponseWriter9writeBodyFPS_22UnsafeHTTPResponseBody_T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterPAAE9writeBodyyAA06UnsafebE0_pF"></a>
|
||||
<a name="//apple_ref/swift/Method/writeBody(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4HTTPPS_18HTTPResponseWriter9writeBodyFPS_22UnsafeHTTPResponseBody_T_">writeBody(_:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterPAAE9writeBodyyAA06UnsafebE0_pF">writeBody(_:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Extension method
|
||||
@@ -549,9 +555,9 @@ This is not currently implemented</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FE4HTTPPS_18HTTPResponseWriter4doneFT_T_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseWriterPAAE4doneyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/done()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4HTTPPS_18HTTPResponseWriter4doneFT_T_">done()</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseWriterPAAE4doneyyF">done()</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Extension method
|
||||
@@ -589,7 +595,7 @@ This is not currently implemented</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -0,0 +1,272 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>HTTPServing Protocol Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
<script src="../js/lunr.min.js" defer></script>
|
||||
<script src="../js/typeahead.jquery.js" defer></script>
|
||||
<script src="../js/jazzy.search.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Protocol/HTTPServing" class="dashAnchor"></a>
|
||||
|
||||
<a title="HTTPServing Protocol Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="../index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(100% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col--secondary">
|
||||
<form role="search" action="../search.json">
|
||||
<input type="text" placeholder="Search documentation" data-typeahead>
|
||||
</form>
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="../index.html">HTTP Reference</a>
|
||||
<img class="carat" src="../img/carat.png" />
|
||||
HTTPServing Protocol Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<h1>HTTPServing</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">HTTPServing</span> <span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Definition of an HTTP server.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP11HTTPServingP5startySi4port_AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF"></a>
|
||||
<a name="//apple_ref/swift/Method/start(port:handler:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPServingP5startySi4port_AA18HTTPBodyProcessingOAA11HTTPRequestV_AA18HTTPResponseWriter_ptc7handlertKF">start(port:handler:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Start the HTTP server on the given <code><a href="../Protocols/HTTPServing.html#/s:4HTTP11HTTPServingP4portSiv">port</a></code>, using <code>handler</code> to process incoming requests</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">start</span><span class="p">(</span><span class="nv">port</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">handler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt"><a href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a></span><span class="p">)</span> <span class="k">throws</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP11HTTPServingP4stopyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/stop()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPServingP4stopyyF">stop()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Stop the server</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">stop</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP11HTTPServingP4portSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/port" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPServingP4portSiv">port</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The port the server is listening on</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">var</span> <span class="nv">port</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:4HTTP11HTTPServingP15connectionCountSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/connectionCount" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPServingP15connectionCountSiv">connectionCount</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The number of current connections</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">var</span> <span class="nv">connectionCount</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -152,9 +158,9 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FV4HTTP11HTTPHeaderscFt17dictionaryLiteralGSaTVS0_4NameSS___S0_"></a>
|
||||
<a name="/s:4HTTP11HTTPHeadersVACSayAC4NameV_SStG17dictionaryLiterald_tcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(dictionaryLiteral:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FV4HTTP11HTTPHeaderscFt17dictionaryLiteralGSaTVS0_4NameSS___S0_">init(dictionaryLiteral:)</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPHeadersVACSayAC4NameV_SStG17dictionaryLiterald_tcfc">init(dictionaryLiteral:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -183,9 +189,9 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FV4HTTP11HTTPHeaders6appendFVS0_7LiteralT_"></a>
|
||||
<a name="/s:4HTTP11HTTPHeadersV6appendyAC7LiteralVF"></a>
|
||||
<a name="//apple_ref/swift/Method/append(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FV4HTTP11HTTPHeaders6appendFVS0_7LiteralT_">append(_:)</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPHeadersV6appendyAC7LiteralVF">append(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -210,9 +216,9 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FV4HTTP11HTTPHeaders7replaceFVS0_7LiteralT_"></a>
|
||||
<a name="/s:4HTTP11HTTPHeadersV7replaceyAC7LiteralVF"></a>
|
||||
<a name="//apple_ref/swift/Method/replace(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FV4HTTP11HTTPHeaders7replaceFVS0_7LiteralT_">replace(_:)</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPHeadersV7replaceyAC7LiteralVF">replace(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -241,9 +247,9 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:VV4HTTP11HTTPHeaders4Name"></a>
|
||||
<a name="/s:4HTTP11HTTPHeadersV4NameV"></a>
|
||||
<a name="//apple_ref/swift/Struct/Name" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:VV4HTTP11HTTPHeaders4Name">Name</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPHeadersV4NameV">Name</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -259,7 +265,7 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Name</span> <span class="p">:</span> <span class="kt">Hashable</span><span class="p">,</span> <span class="kt">ExpressibleByStringLiteral</span><span class="p">,</span> <span class="kt">CustomStringConvertible</span></code></pre>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Name</span><span class="p">:</span> <span class="kt">Hashable</span><span class="p">,</span> <span class="kt">ExpressibleByStringLiteral</span><span class="p">,</span> <span class="kt">CustomStringConvertible</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -274,7 +280,7 @@ Headers are subscriptable using case-insensitive comparison or provide <code>Nam
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP10HTTPMethod6methodSS"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6methodSSv"></a>
|
||||
<a name="//apple_ref/swift/Property/method" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP10HTTPMethod6methodSS">method</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6methodSSv">method</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -172,9 +178,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FV4HTTP10HTTPMethodcFSSS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodVACSScfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FV4HTTP10HTTPMethodcFSSS0_">init(_:)</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodVACSScfc">init(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -203,9 +209,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6deleteS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6deleteACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/delete" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6deleteS0_">delete</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6deleteACvZ">delete</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -230,9 +236,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod3getS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV3getACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/get" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod3getS0_">get</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV3getACvZ">get</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -257,9 +263,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4headS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4headACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/head" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4headS0_">head</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4headACvZ">head</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -284,9 +290,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4postS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4postACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/post" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4postS0_">post</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4postACvZ">post</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -311,9 +317,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod3putS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV3putACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/put" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod3putS0_">put</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV3putACvZ">put</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -338,9 +344,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod7connectS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV7connectACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/connect" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod7connectS0_">connect</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV7connectACvZ">connect</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -365,9 +371,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod7optionsS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV7optionsACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/options" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod7optionsS0_">options</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV7optionsACvZ">options</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -392,9 +398,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod5traceS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV5traceACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/trace" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod5traceS0_">trace</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV5traceACvZ">trace</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -419,9 +425,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4copyS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4copyACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/copy" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4copyS0_">copy</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4copyACvZ">copy</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -446,9 +452,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4lockS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4lockACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/lock" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4lockS0_">lock</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4lockACvZ">lock</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -473,9 +479,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4mkolS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4mkolACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/mkol" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4mkolS0_">mkol</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4mkolACvZ">mkol</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -500,9 +506,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4moveS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4moveACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/move" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4moveS0_">move</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4moveACvZ">move</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -527,9 +533,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod8propfindS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV8propfindACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/propfind" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod8propfindS0_">propfind</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV8propfindACvZ">propfind</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -554,9 +560,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod9proppatchS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV9proppatchACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/proppatch" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod9proppatchS0_">proppatch</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV9proppatchACvZ">proppatch</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -581,9 +587,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6searchS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6searchACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/search" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6searchS0_">search</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6searchACvZ">search</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -608,9 +614,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6unlockS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6unlockACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unlock" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6unlockS0_">unlock</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6unlockACvZ">unlock</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -635,9 +641,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4bindS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4bindACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/bind" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4bindS0_">bind</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4bindACvZ">bind</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -662,9 +668,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6rebindS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6rebindACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/rebind" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6rebindS0_">rebind</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6rebindACvZ">rebind</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -689,9 +695,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6unbindS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6unbindACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unbind" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6unbindS0_">unbind</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6unbindACvZ">unbind</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -716,9 +722,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod3aclS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV3aclACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/acl" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod3aclS0_">acl</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV3aclACvZ">acl</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -743,9 +749,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6reportS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6reportACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/report" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6reportS0_">report</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6reportACvZ">report</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -770,9 +776,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod10mkactivityS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV10mkactivityACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/mkactivity" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod10mkactivityS0_">mkactivity</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV10mkactivityACvZ">mkactivity</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -797,9 +803,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod8checkoutS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV8checkoutACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/checkout" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod8checkoutS0_">checkout</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV8checkoutACvZ">checkout</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -824,9 +830,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod5mergeS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV5mergeACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/merge" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod5mergeS0_">merge</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV5mergeACvZ">merge</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -851,9 +857,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod7msearchS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV7msearchACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/msearch" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod7msearchS0_">msearch</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV7msearchACvZ">msearch</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -878,9 +884,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6notifyS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6notifyACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/notify" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6notifyS0_">notify</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6notifyACvZ">notify</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -905,9 +911,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod9subscribeS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV9subscribeACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/subscribe" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod9subscribeS0_">subscribe</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV9subscribeACvZ">subscribe</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -932,9 +938,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod11unsubscribeS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV11unsubscribeACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unsubscribe" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod11unsubscribeS0_">unsubscribe</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV11unsubscribeACvZ">unsubscribe</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -959,9 +965,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod5patchS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV5patchACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/patch" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod5patchS0_">patch</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV5patchACvZ">patch</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -986,9 +992,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod5purgeS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV5purgeACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/purge" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod5purgeS0_">purge</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV5purgeACvZ">purge</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1013,9 +1019,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod10mkcalendarS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV10mkcalendarACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/mkcalendar" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod10mkcalendarS0_">mkcalendar</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV10mkcalendarACvZ">mkcalendar</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1040,9 +1046,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod4linkS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV4linkACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/link" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod4linkS0_">link</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV4linkACvZ">link</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1067,9 +1073,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP10HTTPMethod6unlinkS0_"></a>
|
||||
<a name="/s:4HTTP10HTTPMethodV6unlinkACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unlink" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP10HTTPMethod6unlinkS0_">unlink</a>
|
||||
<a class="token" href="#/s:4HTTP10HTTPMethodV6unlinkACvZ">unlink</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1098,9 +1104,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vPs8Hashable9hashValueSi"></a>
|
||||
<a name="/s:s8HashableP9hashValueSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/hashValue" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vPs8Hashable9hashValueSi">hashValue</a>
|
||||
<a class="token" href="#/s:s8HashableP9hashValueSiv">hashValue</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1129,7 +1135,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP11HTTPRequest6methodVS_10HTTPMethod"></a>
|
||||
<a name="/s:4HTTP11HTTPRequestV6methodAA10HTTPMethodVv"></a>
|
||||
<a name="//apple_ref/swift/Property/method" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP11HTTPRequest6methodVS_10HTTPMethod">method</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPRequestV6methodAA10HTTPMethodVv">method</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -172,9 +178,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP11HTTPRequest6targetSS"></a>
|
||||
<a name="/s:4HTTP11HTTPRequestV6targetSSv"></a>
|
||||
<a name="//apple_ref/swift/Property/target" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP11HTTPRequest6targetSS">target</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPRequestV6targetSSv">target</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -199,9 +205,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP11HTTPRequest11httpVersionVS_11HTTPVersion"></a>
|
||||
<a name="/s:4HTTP11HTTPRequestV11httpVersionAA11HTTPVersionVv"></a>
|
||||
<a name="//apple_ref/swift/Property/httpVersion" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP11HTTPRequest11httpVersionVS_11HTTPVersion">httpVersion</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPRequestV11httpVersionAA11HTTPVersionVv">httpVersion</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -226,9 +232,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP11HTTPRequest7headersVS_11HTTPHeaders"></a>
|
||||
<a name="/s:4HTTP11HTTPRequestV7headersAA11HTTPHeadersVv"></a>
|
||||
<a name="//apple_ref/swift/Property/headers" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP11HTTPRequest7headersVS_11HTTPHeaders">headers</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPRequestV7headersAA11HTTPHeadersVv">headers</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -258,7 +264,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP12HTTPResponse11httpVersionVS_11HTTPVersion"></a>
|
||||
<a name="/s:4HTTP12HTTPResponseV11httpVersionAA11HTTPVersionVv"></a>
|
||||
<a name="//apple_ref/swift/Property/httpVersion" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP12HTTPResponse11httpVersionVS_11HTTPVersion">httpVersion</a>
|
||||
<a class="token" href="#/s:4HTTP12HTTPResponseV11httpVersionAA11HTTPVersionVv">httpVersion</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -162,7 +168,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">httpVersion</span> <span class="p">:</span> <span class="kt"><a href="../Structs/HTTPVersion.html">HTTPVersion</a></span></code></pre>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">httpVersion</span><span class="p">:</span> <span class="kt"><a href="../Structs/HTTPVersion.html">HTTPVersion</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -172,9 +178,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP12HTTPResponse6statusVS_18HTTPResponseStatus"></a>
|
||||
<a name="/s:4HTTP12HTTPResponseV6statusAA0B6StatusVv"></a>
|
||||
<a name="//apple_ref/swift/Property/status" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP12HTTPResponse6statusVS_18HTTPResponseStatus">status</a>
|
||||
<a class="token" href="#/s:4HTTP12HTTPResponseV6statusAA0B6StatusVv">status</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -199,9 +205,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP12HTTPResponse7headersVS_11HTTPHeaders"></a>
|
||||
<a name="/s:4HTTP12HTTPResponseV7headersAA11HTTPHeadersVv"></a>
|
||||
<a name="//apple_ref/swift/Property/headers" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP12HTTPResponse7headersVS_11HTTPHeaders">headers</a>
|
||||
<a class="token" href="#/s:4HTTP12HTTPResponseV7headersAA11HTTPHeadersVv">headers</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -231,7 +237,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -150,9 +156,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP18HTTPResponseStatus4codeSi"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV4codeSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/code" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP18HTTPResponseStatus4codeSi">code</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV4codeSiv">code</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -177,9 +183,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP18HTTPResponseStatus12reasonPhraseSS"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV12reasonPhraseSSv"></a>
|
||||
<a name="//apple_ref/swift/Property/reasonPhrase" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP18HTTPResponseStatus12reasonPhraseSS">reasonPhrase</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV12reasonPhraseSSv">reasonPhrase</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -204,9 +210,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FV4HTTP18HTTPResponseStatuscFT4codeSi12reasonPhraseSS_S0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusVACSi4code_SS12reasonPhrasetcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(code:reasonPhrase:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FV4HTTP18HTTPResponseStatuscFT4codeSi12reasonPhraseSS_S0_">init(code:reasonPhrase:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusVACSi4code_SS12reasonPhrasetcfc">init(code:reasonPhrase:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -262,9 +268,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FV4HTTP18HTTPResponseStatuscFT4codeSi_S0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusVACSi4code_tcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(code:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FV4HTTP18HTTPResponseStatuscFT4codeSi_S0_">init(code:)</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusVACSi4code_tcfc">init(code:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -309,9 +315,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus8continueS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV8continueACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/continue" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus8continueS0_">continue</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV8continueACvZ">continue</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -336,9 +342,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus18switchingProtocolsS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV18switchingProtocolsACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/switchingProtocols" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus18switchingProtocolsS0_">switchingProtocols</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV18switchingProtocolsACvZ">switchingProtocols</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -363,9 +369,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus2okS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV2okACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/ok" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus2okS0_">ok</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV2okACvZ">ok</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -390,9 +396,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus7createdS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV7createdACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/created" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus7createdS0_">created</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV7createdACvZ">created</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -417,9 +423,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus8acceptedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV8acceptedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/accepted" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus8acceptedS0_">accepted</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV8acceptedACvZ">accepted</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -444,9 +450,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus27nonAuthoritativeInformationS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV27nonAuthoritativeInformationACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/nonAuthoritativeInformation" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus27nonAuthoritativeInformationS0_">nonAuthoritativeInformation</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV27nonAuthoritativeInformationACvZ">nonAuthoritativeInformation</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -471,9 +477,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus9noContentS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV9noContentACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/noContent" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus9noContentS0_">noContent</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV9noContentACvZ">noContent</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -498,9 +504,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus12resetContentS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV12resetContentACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/resetContent" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus12resetContentS0_">resetContent</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV12resetContentACvZ">resetContent</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -525,9 +531,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus14partialContentS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV14partialContentACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/partialContent" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus14partialContentS0_">partialContent</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV14partialContentACvZ">partialContent</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -552,9 +558,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus11multiStatusS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV05multiC0ACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/multiStatus" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus11multiStatusS0_">multiStatus</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV05multiC0ACvZ">multiStatus</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -579,9 +585,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus15alreadyReportedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV15alreadyReportedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/alreadyReported" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus15alreadyReportedS0_">alreadyReported</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV15alreadyReportedACvZ">alreadyReported</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -606,9 +612,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus6imUsedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV6imUsedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/imUsed" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus6imUsedS0_">imUsed</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV6imUsedACvZ">imUsed</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -633,9 +639,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus15multipleChoicesS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV15multipleChoicesACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/multipleChoices" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus15multipleChoicesS0_">multipleChoices</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV15multipleChoicesACvZ">multipleChoices</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -660,9 +666,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus16movedPermanentlyS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV16movedPermanentlyACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/movedPermanently" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus16movedPermanentlyS0_">movedPermanently</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV16movedPermanentlyACvZ">movedPermanently</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -687,9 +693,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus5foundS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5foundACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/found" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus5foundS0_">found</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5foundACvZ">found</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -714,9 +720,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus8seeOtherS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV8seeOtherACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/seeOther" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus8seeOtherS0_">seeOther</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV8seeOtherACvZ">seeOther</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -741,9 +747,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus11notModifiedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV11notModifiedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/notModified" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus11notModifiedS0_">notModified</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV11notModifiedACvZ">notModified</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -768,9 +774,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus8useProxyS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV8useProxyACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/useProxy" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus8useProxyS0_">useProxy</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV8useProxyACvZ">useProxy</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -795,9 +801,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus17temporaryRedirectS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV17temporaryRedirectACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/temporaryRedirect" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus17temporaryRedirectS0_">temporaryRedirect</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV17temporaryRedirectACvZ">temporaryRedirect</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -822,9 +828,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus17permanentRedirectS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV17permanentRedirectACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/permanentRedirect" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus17permanentRedirectS0_">permanentRedirect</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV17permanentRedirectACvZ">permanentRedirect</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -849,9 +855,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus10badRequestS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV10badRequestACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/badRequest" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus10badRequestS0_">badRequest</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV10badRequestACvZ">badRequest</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -876,9 +882,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus12unauthorizedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV12unauthorizedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unauthorized" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus12unauthorizedS0_">unauthorized</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV12unauthorizedACvZ">unauthorized</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -903,9 +909,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus15paymentRequiredS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV15paymentRequiredACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/paymentRequired" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus15paymentRequiredS0_">paymentRequired</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV15paymentRequiredACvZ">paymentRequired</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -930,9 +936,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus9forbiddenS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV9forbiddenACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/forbidden" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus9forbiddenS0_">forbidden</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV9forbiddenACvZ">forbidden</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -957,9 +963,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus8notFoundS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV8notFoundACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/notFound" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus8notFoundS0_">notFound</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV8notFoundACvZ">notFound</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -984,9 +990,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus16methodNotAllowedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV16methodNotAllowedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/methodNotAllowed" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus16methodNotAllowedS0_">methodNotAllowed</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV16methodNotAllowedACvZ">methodNotAllowed</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1011,9 +1017,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus13notAcceptableS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV13notAcceptableACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/notAcceptable" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus13notAcceptableS0_">notAcceptable</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV13notAcceptableACvZ">notAcceptable</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1038,9 +1044,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus27proxyAuthenticationRequiredS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV27proxyAuthenticationRequiredACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/proxyAuthenticationRequired" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus27proxyAuthenticationRequiredS0_">proxyAuthenticationRequired</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV27proxyAuthenticationRequiredACvZ">proxyAuthenticationRequired</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1065,9 +1071,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus14requestTimeoutS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV14requestTimeoutACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/requestTimeout" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus14requestTimeoutS0_">requestTimeout</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV14requestTimeoutACvZ">requestTimeout</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1092,9 +1098,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus8conflictS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV8conflictACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/conflict" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus8conflictS0_">conflict</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV8conflictACvZ">conflict</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1119,9 +1125,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus4goneS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV4goneACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/gone" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus4goneS0_">gone</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV4goneACvZ">gone</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1146,9 +1152,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus14lengthRequiredS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV14lengthRequiredACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/lengthRequired" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus14lengthRequiredS0_">lengthRequired</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV14lengthRequiredACvZ">lengthRequired</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1173,9 +1179,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus18preconditionFailedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV18preconditionFailedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/preconditionFailed" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus18preconditionFailedS0_">preconditionFailed</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV18preconditionFailedACvZ">preconditionFailed</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1200,9 +1206,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus15payloadTooLargeS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV15payloadTooLargeACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/payloadTooLarge" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus15payloadTooLargeS0_">payloadTooLarge</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV15payloadTooLargeACvZ">payloadTooLarge</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1227,9 +1233,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus10uriTooLongS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV10uriTooLongACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/uriTooLong" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus10uriTooLongS0_">uriTooLong</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV10uriTooLongACvZ">uriTooLong</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1254,9 +1260,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus20unsupportedMediaTypeS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV20unsupportedMediaTypeACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unsupportedMediaType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus20unsupportedMediaTypeS0_">unsupportedMediaType</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV20unsupportedMediaTypeACvZ">unsupportedMediaType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1281,9 +1287,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus19rangeNotSatisfiableS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV19rangeNotSatisfiableACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/rangeNotSatisfiable" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus19rangeNotSatisfiableS0_">rangeNotSatisfiable</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV19rangeNotSatisfiableACvZ">rangeNotSatisfiable</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1308,9 +1314,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus17expectationFailedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV17expectationFailedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/expectationFailed" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus17expectationFailedS0_">expectationFailed</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV17expectationFailedACvZ">expectationFailed</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1335,9 +1341,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus18misdirectedRequestS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV18misdirectedRequestACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/misdirectedRequest" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus18misdirectedRequestS0_">misdirectedRequest</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV18misdirectedRequestACvZ">misdirectedRequest</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1362,9 +1368,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus19unprocessableEntityS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV19unprocessableEntityACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unprocessableEntity" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus19unprocessableEntityS0_">unprocessableEntity</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV19unprocessableEntityACvZ">unprocessableEntity</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1389,9 +1395,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus6lockedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV6lockedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/locked" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus6lockedS0_">locked</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV6lockedACvZ">locked</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1416,9 +1422,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus16failedDependencyS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV16failedDependencyACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/failedDependency" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus16failedDependencyS0_">failedDependency</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV16failedDependencyACvZ">failedDependency</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1443,9 +1449,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus15upgradeRequiredS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV15upgradeRequiredACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/upgradeRequired" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus15upgradeRequiredS0_">upgradeRequired</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV15upgradeRequiredACvZ">upgradeRequired</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1470,9 +1476,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus20preconditionRequiredS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV20preconditionRequiredACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/preconditionRequired" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus20preconditionRequiredS0_">preconditionRequired</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV20preconditionRequiredACvZ">preconditionRequired</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1497,9 +1503,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus15tooManyRequestsS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV15tooManyRequestsACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/tooManyRequests" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus15tooManyRequestsS0_">tooManyRequests</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV15tooManyRequestsACvZ">tooManyRequests</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1524,9 +1530,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus27requestHeaderFieldsTooLargeS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV27requestHeaderFieldsTooLargeACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/requestHeaderFieldsTooLarge" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus27requestHeaderFieldsTooLargeS0_">requestHeaderFieldsTooLarge</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV27requestHeaderFieldsTooLargeACvZ">requestHeaderFieldsTooLarge</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1551,9 +1557,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus26unavailableForLegalReasonsS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV26unavailableForLegalReasonsACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/unavailableForLegalReasons" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus26unavailableForLegalReasonsS0_">unavailableForLegalReasons</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV26unavailableForLegalReasonsACvZ">unavailableForLegalReasons</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1578,9 +1584,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus19internalServerErrorS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV19internalServerErrorACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/internalServerError" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus19internalServerErrorS0_">internalServerError</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV19internalServerErrorACvZ">internalServerError</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1605,9 +1611,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus14notImplementedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV14notImplementedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/notImplemented" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus14notImplementedS0_">notImplemented</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV14notImplementedACvZ">notImplemented</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1632,9 +1638,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus10badGatewayS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV10badGatewayACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/badGateway" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus10badGatewayS0_">badGateway</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV10badGatewayACvZ">badGateway</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1659,9 +1665,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus18serviceUnavailableS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV18serviceUnavailableACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/serviceUnavailable" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus18serviceUnavailableS0_">serviceUnavailable</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV18serviceUnavailableACvZ">serviceUnavailable</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1686,9 +1692,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus14gatewayTimeoutS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV14gatewayTimeoutACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/gatewayTimeout" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus14gatewayTimeoutS0_">gatewayTimeout</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV14gatewayTimeoutACvZ">gatewayTimeout</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1713,9 +1719,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus23httpVersionNotSupportedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV23httpVersionNotSupportedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/httpVersionNotSupported" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus23httpVersionNotSupportedS0_">httpVersionNotSupported</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV23httpVersionNotSupportedACvZ">httpVersionNotSupported</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1740,9 +1746,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus21variantAlsoNegotiatesS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV21variantAlsoNegotiatesACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/variantAlsoNegotiates" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus21variantAlsoNegotiatesS0_">variantAlsoNegotiates</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV21variantAlsoNegotiatesACvZ">variantAlsoNegotiates</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1767,9 +1773,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus19insufficientStorageS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV19insufficientStorageACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/insufficientStorage" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus19insufficientStorageS0_">insufficientStorage</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV19insufficientStorageACvZ">insufficientStorage</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1794,9 +1800,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus12loopDetectedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV12loopDetectedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/loopDetected" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus12loopDetectedS0_">loopDetected</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV12loopDetectedACvZ">loopDetected</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1821,9 +1827,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus11notExtendedS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV11notExtendedACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/notExtended" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus11notExtendedS0_">notExtended</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV11notExtendedACvZ">notExtended</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1848,9 +1854,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvV4HTTP18HTTPResponseStatus29networkAuthenticationRequiredS0_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV29networkAuthenticationRequiredACvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/networkAuthenticationRequired" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvV4HTTP18HTTPResponseStatus29networkAuthenticationRequiredS0_">networkAuthenticationRequired</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV29networkAuthenticationRequiredACvZ">networkAuthenticationRequired</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1875,9 +1881,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP18HTTPResponseStatus5classOS0_5Class"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5classAC5ClassOv"></a>
|
||||
<a name="//apple_ref/swift/Property/class" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP18HTTPResponseStatus5classOS0_5Class">class</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5classAC5ClassOv">class</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1905,9 +1911,9 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:OV4HTTP18HTTPResponseStatus5Class"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5ClassO"></a>
|
||||
<a name="//apple_ref/swift/Enum/Class" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:OV4HTTP18HTTPResponseStatus5Class">Class</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5ClassO">Class</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1943,7 +1949,7 @@ The reason phrase is added for the status code, or <q>http_(code)</q> if the cod
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -150,9 +156,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOV4HTTP18HTTPResponseStatus5Class13informationalFMS1_S1_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5ClassO13informationalA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/informational" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOV4HTTP18HTTPResponseStatus5Class13informationalFMS1_S1_">informational</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5ClassO13informationalA2EmF">informational</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -181,9 +187,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOV4HTTP18HTTPResponseStatus5Class10successfulFMS1_S1_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5ClassO10successfulA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/successful" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOV4HTTP18HTTPResponseStatus5Class10successfulFMS1_S1_">successful</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5ClassO10successfulA2EmF">successful</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -212,9 +218,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOV4HTTP18HTTPResponseStatus5Class11redirectionFMS1_S1_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5ClassO11redirectionA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/redirection" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOV4HTTP18HTTPResponseStatus5Class11redirectionFMS1_S1_">redirection</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5ClassO11redirectionA2EmF">redirection</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -243,9 +249,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOV4HTTP18HTTPResponseStatus5Class11clientErrorFMS1_S1_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5ClassO11clientErrorA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/clientError" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOV4HTTP18HTTPResponseStatus5Class11clientErrorFMS1_S1_">clientError</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5ClassO11clientErrorA2EmF">clientError</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -274,9 +280,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOV4HTTP18HTTPResponseStatus5Class11serverErrorFMS1_S1_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5ClassO11serverErrorA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/serverError" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOV4HTTP18HTTPResponseStatus5Class11serverErrorFMS1_S1_">serverError</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5ClassO11serverErrorA2EmF">serverError</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -305,9 +311,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOV4HTTP18HTTPResponseStatus5Class13invalidStatusFMS1_S1_"></a>
|
||||
<a name="/s:4HTTP18HTTPResponseStatusV5ClassO07invalidC0A2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/invalidStatus" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOV4HTTP18HTTPResponseStatus5Class13invalidStatusFMS1_S1_">invalidStatus</a>
|
||||
<a class="token" href="#/s:4HTTP18HTTPResponseStatusV5ClassO07invalidC0A2EmF">invalidStatus</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -337,7 +343,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/HTTP/">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -54,10 +54,16 @@
|
||||
<a class="nav-group-name-link" href="../HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/WebAppContaining.html">WebAppContaining</a>
|
||||
<a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP6WebApp">WebApp</a>
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -85,7 +91,7 @@
|
||||
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandler">HTTPBodyHandler</a>
|
||||
<a class="nav-group-task-link" href="../HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
@@ -145,9 +151,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP11HTTPVersion5majorSi"></a>
|
||||
<a name="/s:4HTTP11HTTPVersionV5majorSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/major" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP11HTTPVersion5majorSi">major</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPVersionV5majorSiv">major</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -172,9 +178,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vV4HTTP11HTTPVersion5minorSi"></a>
|
||||
<a name="/s:4HTTP11HTTPVersionV5minorSiv"></a>
|
||||
<a name="//apple_ref/swift/Property/minor" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vV4HTTP11HTTPVersion5minorSi">minor</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPVersionV5minorSiv">minor</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -199,9 +205,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FV4HTTP11HTTPVersioncFT5majorSi5minorSi_S0_"></a>
|
||||
<a name="/s:4HTTP11HTTPVersionVACSi5major_Si5minortcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(major:minor:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FV4HTTP11HTTPVersioncFT5majorSi5minorSi_S0_">init(major:minor:)</a>
|
||||
<a class="token" href="#/s:4HTTP11HTTPVersionVACSi5major_Si5minortcfc">init(major:minor:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -231,7 +237,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift.org Server APIs Project</a>. All rights reserved. (Last updated: 2017-08-11)</p>
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
Before Width: | Height: | Size: 274 B After Width: | Height: | Size: 274 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,216 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>HTTP Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
<script src="js/lunr.min.js" defer></script>
|
||||
<script src="js/typeahead.jquery.js" defer></script>
|
||||
<script src="js/jazzy.search.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<a title="HTTP Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="index.html">
|
||||
HTTP Docs
|
||||
</a>
|
||||
(100% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col--secondary">
|
||||
<form role="search" action="search.json">
|
||||
<input type="text" placeholder="Search documentation" data-typeahead>
|
||||
</form>
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/swift-server/http/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="index.html">HTTP Reference</a>
|
||||
<img class="carat" src="img/carat.png" />
|
||||
HTTP Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Server.html">HTTP Server</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPServing.html">HTTPServing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Server.html#/s:4HTTP18HTTPRequestHandlera">HTTPRequestHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPRequestHandling.html">HTTPRequestHandling</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Headers.html">HTTP Headers</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders.html">HTTPHeaders</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPHeaders/Name.html">– Name</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPVersion.html">HTTPVersion</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Request.html">HTTP Request</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPRequest.html">HTTPRequest</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPMethod.html">HTTPMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="HTTP Request.html#/s:4HTTP15HTTPBodyHandlera">HTTPBodyHandler</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyProcessing.html">HTTPBodyProcessing</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/HTTPBodyChunk.html">HTTPBodyChunk</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="HTTP Response.html">HTTP Response</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponse.html">HTTPResponse</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus.html">HTTPResponseStatus</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/HTTPResponseStatus/Class.html">– Class</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Protocols/HTTPResponseWriter.html">HTTPResponseWriter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="Other Enums.html">Other Enums</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Enums/Result.html">Result</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
|
||||
<h1 id='swift-server-project-http-apis' class='heading'>Swift Server Project HTTP APIs</h1>
|
||||
|
||||
<p>This is an early implementation of the Swift Server Project’s HTTP APIs. This provides simple HTTP server on which rich web application frameworks can be built.</p>
|
||||
<h2 id='getting-started' class='heading'>Getting Started</h2>
|
||||
<h3 id='hello-world' class='heading'>Hello World</h3>
|
||||
|
||||
<p>The following code implements a very simple <q>Hello World!</q> server:</p>
|
||||
<pre class="highlight swift"><code><span class="kd">import</span> <span class="kt">Foundation</span>
|
||||
<span class="kd">import</span> <span class="kt">HTTP</span>
|
||||
|
||||
<span class="kd">func</span> <span class="nf">hello</span><span class="p">(</span><span class="nv">request</span><span class="p">:</span> <span class="kt">HTTPRequest</span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt">HTTPResponseWriter</span> <span class="p">)</span> <span class="o">-></span> <span class="kt">HTTPBodyProcessing</span> <span class="p">{</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">writeHeader</span><span class="p">(</span><span class="nv">status</span><span class="p">:</span> <span class="o">.</span><span class="n">ok</span><span class="p">)</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">writeBody</span><span class="p">(</span><span class="s">"Hello, World!"</span><span class="p">)</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">done</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="o">.</span><span class="n">discardBody</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="k">let</span> <span class="nv">server</span> <span class="o">=</span> <span class="kt">HTTPServer</span><span class="p">()</span>
|
||||
<span class="k">try!</span> <span class="n">server</span><span class="o">.</span><span class="nf">start</span><span class="p">(</span><span class="nv">port</span><span class="p">:</span> <span class="mi">8080</span><span class="p">,</span> <span class="nv">handler</span><span class="p">:</span> <span class="n">hello</span><span class="p">)</span>
|
||||
|
||||
<span class="kt">CFRunLoopRun</span><span class="p">()</span>
|
||||
</code></pre>
|
||||
|
||||
<p>The <code>hello()</code> function receives a <code>HTTPRequest</code> that describes the request and a <code>HTTPResponseWriter</code> used to write a response. </p>
|
||||
|
||||
<p>Data that is received as part of the request body is made available to the closure that is returned by the <code>hello()</code> function. In the <q>Hello World!</q> example the request body is not used, so <code>.discardBody</code> is returned.</p>
|
||||
<h3 id='echo-server' class='heading'>Echo Server</h3>
|
||||
|
||||
<p>The following code implements a very simple Echo server that responds with the contents of the incoming request:</p>
|
||||
<pre class="highlight swift"><code><span class="kd">import</span> <span class="kt">Foundation</span>
|
||||
<span class="kd">import</span> <span class="kt">HTTP</span>
|
||||
|
||||
<span class="kd">func</span> <span class="nf">echo</span><span class="p">(</span><span class="nv">request</span><span class="p">:</span> <span class="kt">HTTPRequest</span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt">HTTPResponseWriter</span> <span class="p">)</span> <span class="o">-></span> <span class="kt">HTTPBodyProcessing</span> <span class="p">{</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">writeHeader</span><span class="p">(</span><span class="nv">status</span><span class="p">:</span> <span class="o">.</span><span class="n">ok</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="o">.</span><span class="n">processBody</span> <span class="p">{</span> <span class="p">(</span><span class="n">chunk</span><span class="p">,</span> <span class="n">stop</span><span class="p">)</span> <span class="k">in</span>
|
||||
<span class="k">switch</span> <span class="n">chunk</span> <span class="p">{</span>
|
||||
<span class="k">case</span> <span class="o">.</span><span class="nf">chunk</span><span class="p">(</span><span class="k">let</span> <span class="nv">data</span><span class="p">,</span> <span class="k">let</span> <span class="nv">finishedProcessing</span><span class="p">):</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">writeBody</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="p">{</span> <span class="n">_</span> <span class="k">in</span>
|
||||
<span class="nf">finishedProcessing</span><span class="p">()</span>
|
||||
<span class="p">}</span>
|
||||
<span class="k">case</span> <span class="o">.</span><span class="nv">end</span><span class="p">:</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">done</span><span class="p">()</span>
|
||||
<span class="k">default</span><span class="p">:</span>
|
||||
<span class="n">stop</span> <span class="o">=</span> <span class="kc">true</span>
|
||||
<span class="n">response</span><span class="o">.</span><span class="nf">abort</span><span class="p">()</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="k">let</span> <span class="nv">server</span> <span class="o">=</span> <span class="kt">HTTPServer</span><span class="p">()</span>
|
||||
<span class="k">try!</span> <span class="n">server</span><span class="o">.</span><span class="nf">start</span><span class="p">(</span><span class="nv">port</span><span class="p">:</span> <span class="mi">8080</span><span class="p">,</span> <span class="nv">handler</span><span class="p">:</span> <span class="n">echo</span><span class="p">)</span>
|
||||
|
||||
<span class="kt">CFRunLoopRun</span><span class="p">()</span>
|
||||
</code></pre>
|
||||
|
||||
<p>As the Echo server needs to process the request body data and return it in the reponse, the <code>echo()</code> function returns a <code>.processBody</code> closure. This closure is called with <code>.chunk</code> when data is available for processing from the request, and <code>.end</code> when no more data is available.</p>
|
||||
|
||||
<p>Once any data chunk has been processed, <code>finishedProcessing()</code> should be called to signify that it has been handled.</p>
|
||||
|
||||
<p>When the response is complete, <code>response.done()</code> should be called.</p>
|
||||
<h2 id='api-documentation' class='heading'>API Documentation</h2>
|
||||
|
||||
<p>Full Jazzy documentation of the API is available here:<br>
|
||||
<a href="https://swift-server.github.io/http/">https://swift-server.github.io/http/</a></p>
|
||||
<h2 id='acknowledgements' class='heading'>Acknowledgements</h2>
|
||||
|
||||
<p>This project is based on an inital proposal from @weissi on the swift-server-dev mailing list:<br>
|
||||
<a href="https://lists.swift.org/pipermail/swift-server-dev/Week-of-Mon-20170403/000422.html">https://lists.swift.org/pipermail/swift-server-dev/Week-of-Mon-20170403/000422.html</a></p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2017 <a class="link" href="" target="_blank" rel="external">Swift Server API project</a>. All rights reserved. (Last updated: 2017-10-02)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||