Skip to content

Instantly share code, notes, and snippets.

View loromits's full-sized avatar

Anton Kovtun loromits

  • Mykolayiv, Ukraine
View GitHub Profile
@shaps80
shaps80 / cURL+Request.swift
Last active July 18, 2024 14:25
Generates a cURL command representation of a URLRequest in Swift.
import Foundation
extension URLRequest {
/**
Returns a cURL command representation of this URL request.
*/
public var curlString: String {
guard let url = url else { return "" }
var baseCommand = #"curl "\#(url.absoluteString)""#