diff --git a/Libraries/Sources/APIService/Endpoints/DeleteItemEndpoint.swift b/Libraries/Sources/APIService/Endpoints/DeleteItemEndpoint.swift index 7ada098..f5b44c7 100644 --- a/Libraries/Sources/APIService/Endpoints/DeleteItemEndpoint.swift +++ b/Libraries/Sources/APIService/Endpoints/DeleteItemEndpoint.swift @@ -6,12 +6,14 @@ // Copyright © 2022 Röck+Cöde. All rights reserved. // +import Foundation + struct DeleteItemEndpoint: Endpoint { let path: String let method: RequestMethod let credentials: BasicCredentials let headers: [String : String] - let body: [String : String]? + let body: Data? } // MARK: - Initialisers diff --git a/Libraries/Sources/APIService/Endpoints/GetDataEndpoint.swift b/Libraries/Sources/APIService/Endpoints/GetDataEndpoint.swift index c21bdf2..026bedd 100644 --- a/Libraries/Sources/APIService/Endpoints/GetDataEndpoint.swift +++ b/Libraries/Sources/APIService/Endpoints/GetDataEndpoint.swift @@ -6,12 +6,14 @@ // Copyright © 2022 Röck+Cöde. All rights reserved. // +import Foundation + struct GetDataEndpoint: Endpoint { let path: String let method: RequestMethod let credentials: BasicCredentials let headers: [String : String] - let body: [String : String]? + let body: Data? } // MARK: - Initialisers diff --git a/Libraries/Sources/APIService/Endpoints/GetItemsEndpoint.swift b/Libraries/Sources/APIService/Endpoints/GetItemsEndpoint.swift index c60b263..6e74867 100644 --- a/Libraries/Sources/APIService/Endpoints/GetItemsEndpoint.swift +++ b/Libraries/Sources/APIService/Endpoints/GetItemsEndpoint.swift @@ -6,12 +6,14 @@ // Copyright © 2022 Röck+Cöde. All rights reserved. // +import Foundation + struct GetItemsEndpoint: Endpoint { let path: String let method: RequestMethod let credentials: BasicCredentials let headers: [String : String] - let body: [String : String]? + let body: Data? } // MARK: - Initialisers diff --git a/Libraries/Sources/APIService/Endpoints/GetMeEndpoint.swift b/Libraries/Sources/APIService/Endpoints/GetMeEndpoint.swift index c2ff363..7dbd729 100644 --- a/Libraries/Sources/APIService/Endpoints/GetMeEndpoint.swift +++ b/Libraries/Sources/APIService/Endpoints/GetMeEndpoint.swift @@ -6,12 +6,14 @@ // Copyright © 2022 Röck+Cöde. All rights reserved. // +import Foundation + struct GetMeEndpoint: Endpoint { let path: String let method: RequestMethod let credentials: BasicCredentials let headers: [String : String] - let body: [String : String]? + let body: Data? } // MARK: - Initialisers diff --git a/Libraries/Sources/APIService/Protocols/Endpoint.swift b/Libraries/Sources/APIService/Protocols/Endpoint.swift index af12ed8..bac6dfa 100644 --- a/Libraries/Sources/APIService/Protocols/Endpoint.swift +++ b/Libraries/Sources/APIService/Protocols/Endpoint.swift @@ -6,6 +6,8 @@ // Copyright © 2022 Röck+Cöde. All rights reserved. // +import Foundation + protocol Endpoint { var scheme: String { get } var host: String { get } @@ -13,7 +15,7 @@ protocol Endpoint { var method: RequestMethod { get } var credentials: BasicCredentials { get } var headers: [String: String] { get } - var body: [String: String]? { get } + var body: Data? { get } } // MARK: - Defaults diff --git a/Libraries/Tests/APIServiceTests/Cases/Endpoints/DeleteItemEndpoint+InitTests.swift b/Libraries/Tests/APIServiceTests/Cases/Endpoints/DeleteItemEndpoint+InitTests.swift index 77c888c..6382881 100644 --- a/Libraries/Tests/APIServiceTests/Cases/Endpoints/DeleteItemEndpoint+InitTests.swift +++ b/Libraries/Tests/APIServiceTests/Cases/Endpoints/DeleteItemEndpoint+InitTests.swift @@ -47,7 +47,7 @@ final class DeleteItemEndpoint_InitTests: XCTestCase { XCTAssertNil(endpoint.body) } - func test_withItemId_andEmptyUsernameOrPassword() async throws { + func test_withItemId_andEmptyUsernameOrPassword() throws { // GIVEN username = "" password = "password" diff --git a/Libraries/Tests/APIServiceTests/Cases/Endpoints/GetDataEndpoint+InitTests.swift b/Libraries/Tests/APIServiceTests/Cases/Endpoints/GetDataEndpoint+InitTests.swift index 3803111..23885cf 100644 --- a/Libraries/Tests/APIServiceTests/Cases/Endpoints/GetDataEndpoint+InitTests.swift +++ b/Libraries/Tests/APIServiceTests/Cases/Endpoints/GetDataEndpoint+InitTests.swift @@ -47,7 +47,7 @@ final class GetDataEndpointInitTests: XCTestCase { XCTAssertNil(endpoint.body) } - func test_withItemId_andEmptyUsernameOrPassword() async throws { + func test_withItemId_andEmptyUsernameOrPassword() throws { // GIVEN username = "" password = "password" diff --git a/Libraries/Tests/APIServiceTests/Cases/Endpoints/GetItemsEndpoint+InitTests.swift b/Libraries/Tests/APIServiceTests/Cases/Endpoints/GetItemsEndpoint+InitTests.swift index 1834a34..1e7a2f1 100644 --- a/Libraries/Tests/APIServiceTests/Cases/Endpoints/GetItemsEndpoint+InitTests.swift +++ b/Libraries/Tests/APIServiceTests/Cases/Endpoints/GetItemsEndpoint+InitTests.swift @@ -47,7 +47,7 @@ final class GetItemsEndpointInitTests: XCTestCase { XCTAssertNil(endpoint.body) } - func test_withItemId_andEmptyUsernameOrPassword() async throws { + func test_withItemId_andEmptyUsernameOrPassword() throws { // GIVEN username = "" password = "password" diff --git a/Libraries/Tests/APIServiceTests/Cases/Endpoints/GetMeEndpoint+InitTests.swift b/Libraries/Tests/APIServiceTests/Cases/Endpoints/GetMeEndpoint+InitTests.swift index 9befdf0..ddd722e 100644 --- a/Libraries/Tests/APIServiceTests/Cases/Endpoints/GetMeEndpoint+InitTests.swift +++ b/Libraries/Tests/APIServiceTests/Cases/Endpoints/GetMeEndpoint+InitTests.swift @@ -40,7 +40,7 @@ final class GetMeEndpointInitTests: XCTestCase { XCTAssertNil(endpoint.body) } - func test_withEmptyUsernameOrPassword() async throws { + func test_withEmptyUsernameOrPassword() throws { // GIVEN username = "" password = "password"