Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Example/Usage.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// File.swift
// SwiftNetworkKit
//
// Created by Stephen T. Sagarino Jr. on 10/2/25.
//

import Foundation

struct Usage {

let session =
SNKSession(urlSession: .shared)
.request(url: "https://vueuse.org/core/useFetch/")
.method(.get)

}
19 changes: 19 additions & 0 deletions Sources/SwiftNetworkKit/Core/HTTPMethod.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// File.swift
// SwiftNetworkKit
//
// Created by Stephen T. Sagarino Jr. on 10/2/25.
//

import Foundation

public enum HTTPMethod: String {
case get = "GET"
case post = "POST"
case put = "PUT"
case delete = "DELETE"
case patch = "PATCH"
case head = "HEAD"
case options = "OPTIONS"
case trace = "TRACE"
}
32 changes: 32 additions & 0 deletions Sources/SwiftNetworkKit/Core/SNKDataRequest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// File 2.swift
// SwiftNetworkKit
//
// Created by Stephen T. Sagarino Jr. on 10/2/25.
//

import Combine
import Foundation

open class SNKDataRequest: @unchecked Sendable {

open private(set) var method: HTTPMethod = .get
open private(set) var coder: JSONDecoder = JSONDecoder()
// open private(set) var decoder: JSONDecoder = .get
//
// open func method(_ method: HTTPMethod) -> SNKDataRequest {
// self.method = method
// return self
// }

open func method(_ method: HTTPMethod) -> SNKDataRequest {
self.method = method
return self
}

open func coder(_ method: HTTPMethod) -> SNKDataRequest {
self.method = method
return self
}

}
24 changes: 24 additions & 0 deletions Sources/SwiftNetworkKit/Core/SNKSession.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// File.swift
// SwiftNetworkKit
//
// Created by Stephen T. Sagarino Jr. on 10/2/25.
//

import Foundation

open class SNKSession: @unchecked Sendable {

let urlSession: URLSession

init(
urlSession: URLSession
) {
self.urlSession = urlSession
}

open func request(url: String) -> SNKDataRequest {
.init()
}

}