Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/0xopenbytes/network

πŸ•ΈοΈ Output and Input for remote URLs using REST
https://github.com/0xopenbytes/network

async-await datatask get headers network post rest swift url urlsession

Last synced: about 20 hours ago
JSON representation

πŸ•ΈοΈ Output and Input for remote URLs using REST

Awesome Lists containing this project

README

        

# Network

Network is a convenience typealias for `o.url` that represents network access. `o.url` is a group of functions in the `o` module that provides network access and manipulation operations.

## Usage
To use `Network`, simply import `Network` and use the `Network` typealias in your code:

```swift
import Network

// Get data from a URL
let data = try await Network.get(url: URL(string: "https://example.com/data.json")!)

// Post data to a URL
let postData = "Hello, world!".data(using: .utf8)!
try await Network.post(url: URL(string: "https://example.com/post")!, body: postData)
```