-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renames HttpBodyConvertable to HttpBodyConvertible
- Loading branch information
Showing
4 changed files
with
9 additions
and
11 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...rking/Multipart/HttpBodyConvertable.swift → ...rking/Multipart/HttpBodyConvertible.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// | ||
// HttpBodyConvertable.swift | ||
// HttpBodyConvertible.swift | ||
// | ||
// | ||
// Created by Jeff Barg on 07/22/2020. | ||
// | ||
|
||
import Foundation | ||
|
||
public protocol HttpBodyConvertable { | ||
public protocol HttpBodyConvertible { | ||
func buildHttpBodyPart(boundary: String) -> Data | ||
} |
4 changes: 2 additions & 2 deletions
4
...t/MultipartData+HttpBodyConvertable.swift → ...t/MultipartData+HttpBodyConvertible.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
...ultipart/Params+HttpBodyConvertable.swift → ...ultipart/Params+HttpBodyConvertible.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
// | ||
// Params+HttpBodyConvertable.swift | ||
// Params+HttpBodyConvertible.swift | ||
// | ||
// | ||
// Created by Jeff Barg on 07/22/2020. | ||
// | ||
|
||
import Foundation | ||
|
||
extension Params: HttpBodyConvertable { | ||
extension Params: HttpBodyConvertible { | ||
public func buildHttpBodyPart(boundary: String) -> Data { | ||
let httpBody = NSMutableData() | ||
|
||
self.forEach { (name, value) in | ||
forEach { (name, value) in | ||
httpBody.appendString("--\(boundary)\r\n") | ||
httpBody.appendString("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") | ||
httpBody.appendString(value.description) | ||
httpBody.appendString("\r\n") | ||
} | ||
|
||
return httpBody as Data | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters