KHUYẾN CÁO: Tôi là tác giả của hai loại đá quý được liệt kê ở đây bên dưới.
Nếu bạn muốn phát hành cuộc gọi HTTP/2, bạn có thể xem xét NetHttp2, ứng dụng HTTP/2 cho Ruby.
Cách sử dụng ví dụ cho đồng bộ gọi:
require 'net-http2'
# create a client
client = NetHttp2::Client.new("http://106.186.112.116")
# send request
response = client.call(:get, '/')
# read the response
response.ok? # => true
response.status # => '200'
response.headers # => {":status"=>"200"}
response.body # => "A body"
# close the connection
client.close
Trên đầu trang của văn bản HTTP/2 gọi cho mình, nếu bạn muốn một Apple Push Notification đá quý có sử dụng HTTP/2 chi tiết cụ thể mới và có thể được nhúng vào trong một Rails môi trường sau đó bạn cũng có thể xem xét Apnotic.
Cách sử dụng rất đơn giản:
require 'apnotic'
# create a persistent connection
connection = Apnotic::Connection.new(cert_path: "apns_certificate.pem", cert_pass: "pass")
# create a notification for a specific device token
token = "6c267f26b173cd9595ae2f6702b1ab560371a60e7c8a9e27419bd0fa4a42e58f"
notification = Apnotic::Notification.new(token)
notification.alert = "Notification from Apnotic!"
# send (this is a blocking call)
response = connection.push(notification)
# read the response
response.ok? # => true
response.status # => '200'
response.headers # => {":status"=>"200", "apns-id"=>"6f2cd350-bfad-4af0-a8bc-0d501e9e1799"}
response.body # => ""
# close the connection
connection.close
Bạn là người đầu tiên tôi nghe nói rằng đang cố gắng sử dụng HTTP2, chúc may mắn, bạn sẽ cần nó: D – bbozo