为什么我没有从 Firebase 服务器获取 HTTP 状态代码? Swift - Vapor 服务器
Why don't I get a HTTP status code from Firebase Server? Swift - Vapor server
我正在使用 Firebase REST API 从 Vapor 服务器写入 Firebase 数据库。为什么我在收到的 header 中没有得到 状态代码 ?这将使我能够检查写入是否成功。
headerReceived items line 83 in
extensionPutRequestToUsersClaimBookingCleaner are
([Connection: "keep-alive", Cache-Control: "no-cache", Server:
"nginx", Date: "Sun, 27 Aug 2017 21:47:25 GMT", Content-Type:
"application/json; charset=utf-8", Content-Length: "1027",
Strict-Transport-Security: "max-age=31556926; includeSubDomains;
preload", Access-Control-Allow-Origin: "*"])
响应的状态代码在 status
属性 而不是 headers
属性.
中返回
guard response.status == .created else {
// not a 201 response
}
我正在使用 Firebase REST API 从 Vapor 服务器写入 Firebase 数据库。为什么我在收到的 header 中没有得到 状态代码 ?这将使我能够检查写入是否成功。
headerReceived items line 83 in extensionPutRequestToUsersClaimBookingCleaner are
([Connection: "keep-alive", Cache-Control: "no-cache", Server: "nginx", Date: "Sun, 27 Aug 2017 21:47:25 GMT", Content-Type: "application/json; charset=utf-8", Content-Length: "1027", Strict-Transport-Security: "max-age=31556926; includeSubDomains; preload", Access-Control-Allow-Origin: "*"])
响应的状态代码在 status
属性 而不是 headers
属性.
guard response.status == .created else {
// not a 201 response
}