Skip to content
Merged
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
2 changes: 2 additions & 0 deletions Sources/OpenAI/Private/Networking/Endpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public enum HTTPMethod: String {
case post = "POST"
case get = "GET"
case delete = "DELETE"
case patch = "PATCH"
case put = "PUT"
}

// MARK: - Endpoint
Expand Down
12 changes: 6 additions & 6 deletions Sources/OpenAI/Private/Networking/HTTPClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,23 @@ public struct HTTPRequest {
}

/// The URL for the request
var url: URL
public var url: URL
/// The HTTP method for the request
var method: HTTPMethod
public var method: HTTPMethod
/// The HTTP headers for the request
var headers: [String: String]
public var headers: [String: String]
/// The body of the request, if any
var body: Data?
public var body: Data?
}

// MARK: - HTTPResponse

/// Represents an HTTP response with platform-agnostic properties
public struct HTTPResponse {
/// The HTTP status code of the response
var statusCode: Int
public var statusCode: Int
/// The HTTP headers in the response
var headers: [String: String]
public var headers: [String: String]

public init(statusCode: Int, headers: [String: String]) {
self.statusCode = statusCode
Expand Down
Loading