Go to file
Leif c6c40ef1d9 init 2023-03-06 17:35:57 -07:00
.github/workflows init 2023-03-06 17:35:57 -07:00
Sources/Network init 2023-03-06 17:35:57 -07:00
Tests/NetworkTests init 2023-03-06 17:35:57 -07:00
.gitignore init 2023-03-06 17:35:57 -07:00
Package.resolved init 2023-03-06 17:35:57 -07:00
Package.swift init 2023-03-06 17:35:57 -07:00
README.md init 2023-03-06 17:35:57 -07:00

README.md

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:

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)