Skip to content

Commit

Permalink
fix(Content): MultiPart.File have no initilizer (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
rockmagma02 authored Apr 25, 2024
1 parent 72ab964 commit 2943516
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Sources/HttpX/Content/MultiPart.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,30 @@ public class MultiPart {

/// Represents a file to be included in a multipart/form-data request.
public struct File {
// MARK: Lifecycle

/// Initializes a new instance of the File struct.
///
/// - Parameters:
/// - path: The URL path to the file.
/// - filename: The filename to be used in the multipart/form-data request. Optional.
/// - contentType: The MIME type of the file. Optional.
/// - headers: Additional headers to be included for this file part. defaults
/// to an empty dictionary.
public init(
path: URL,
filename: String? = nil,
contentType: String? = nil,
headers: [String: String] = [:]
) {
self.path = path
self.filename = filename
self.contentType = contentType
self.headers = headers
}

// MARK: Public

/// The URL path to the file.
public var path: URL
/// The filename to be used in the multipart/form-data request. Optional.
Expand Down

0 comments on commit 2943516

Please sign in to comment.