diff --git a/Sources/InfomaniakCore/Networking/ApiFetcher.swift b/Sources/InfomaniakCore/Networking/ApiFetcher.swift index e2374bf..3f18adf 100644 --- a/Sources/InfomaniakCore/Networking/ApiFetcher.swift +++ b/Sources/InfomaniakCore/Networking/ApiFetcher.swift @@ -199,8 +199,8 @@ open class ApiFetcher { try await perform(request: authenticatedRequest(.organisationAccounts)) } - public func userProfile(ignoreDefaultAvatar: Bool = false) async throws -> UserProfile { - try await perform(request: authenticatedRequest(.profile(ignoreDefaultAvatar: ignoreDefaultAvatar))) + public func userProfile(ignoreDefaultAvatar: Bool = false, dateFormat: DateFormat = .json) async throws -> UserProfile { + try await perform(request: authenticatedRequest(.profile(ignoreDefaultAvatar: ignoreDefaultAvatar), headers: ["X-Date-Format": dateFormat.rawValue])) } } diff --git a/Sources/InfomaniakCore/Networking/DateFormat.swift b/Sources/InfomaniakCore/Networking/DateFormat.swift new file mode 100644 index 0000000..fc1fd67 --- /dev/null +++ b/Sources/InfomaniakCore/Networking/DateFormat.swift @@ -0,0 +1,24 @@ +/* + Infomaniak Core - iOS + Copyright (C) 2022 Infomaniak Network SA + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +import Foundation + +public enum DateFormat: String { + case iso8601 + case json = "application/json" +}