{"id":20003515,"url":"https://github.com/nathanborror/swift-http2","last_synced_at":"2025-05-04T15:35:02.726Z","repository":{"id":66667392,"uuid":"70414979","full_name":"nathanborror/swift-http2","owner":"nathanborror","description":"📡 A very basic Swift HTTP/2 library.","archived":false,"fork":false,"pushed_at":"2016-10-23T04:40:04.000Z","size":6,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T08:06:07.386Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nathanborror.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-09T16:14:15.000Z","updated_at":"2021-04-22T00:22:58.000Z","dependencies_parsed_at":"2023-03-24T13:32:11.812Z","dependency_job_id":null,"html_url":"https://github.com/nathanborror/swift-http2","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanborror%2Fswift-http2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanborror%2Fswift-http2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanborror%2Fswift-http2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanborror%2Fswift-http2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathanborror","download_url":"https://codeload.github.com/nathanborror/swift-http2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252357438,"owners_count":21735145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T05:26:01.759Z","updated_at":"2025-05-04T15:35:02.718Z","avatar_url":"https://github.com/nathanborror.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift Http2\n\nA very simple [HTTP/2][1] library for Swift.\n\n---\n\n:warning: There is active work going on here that will result in API changes. :warning:\n\n---\n\n## Usage\n\n```swift\nclass MyDelegate: NSObject, Http2SessionDelegate {\n\n  public func sessionConnected(session: http2Session) {}\n  public func session(session: http2Session, hasFrame frame: Frame) {}\n}\n\nlet session = Http2Session(url: URL(string: \"http://localhost\")!)\nlet sessionDelegate = MyDelegate()\nsession.delegate = sessionDelegate\n\n// Connect to host\nsession.connect()\n\n// Get a new stream ID\nlet stream = session.streams.next()\n\n\n// Set some headers\nlet headers = [\n  (\":method\", \"POST\"),\n  (\":scheme\", \"http\"),\n  (\":path\", \"/\"),\n  (\"content-type\", \"application/json\"),\n  (\"te\", \"trailers\"),\n]\n\n// Create a header frame and write it to the session\nlet frame = Frame(headers: headers, stream: stream, flags: .endHeaders)\ntry? session.write(frame: frame)\n\n// Create a data frame and send some bytes\nlet bytes = [UInt8]()\nlet data = Frame(data: bytes, stream: stream, flags: .endStream)\ntry? session.write(frame: data)\n\n// Disconnect from host\nsession.disconnect()\n```\n\n[1]:https://tools.ietf.org/html/rfc7540\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanborror%2Fswift-http2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathanborror%2Fswift-http2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanborror%2Fswift-http2/lists"}