@@ -37,6 +37,12 @@ public struct ParseConfiguration {
3737 /// - warning: This is known not to work for LiveQuery on Parse Servers <= 5.0.0.
3838 public internal( set) var isUsingEqualQueryConstraint = false
3939
40+ /// Use **POST** instead of **GET** when making query calls.
41+ /// Defaults to **false**.
42+ /// - warning: **POST** calls are not cached and will require all queries to access the
43+ /// server instead of following the `requestCachePolicy`.
44+ public internal( set) var isUsingPostForQuery = false
45+
4046 /// The default caching policy for all http requests that determines when to
4147 /// return a response from the cache. Defaults to `useProtocolCachePolicy`.
4248 /// See Apple's [documentation](https://developer.apple.com/documentation/foundation/url_loading_system/accessing_cached_data)
@@ -85,6 +91,8 @@ public struct ParseConfiguration {
8591 side for each object. Must be enabled on the server to work.
8692 - parameter usingTransactions: Use transactions when saving/updating multiple objects.
8793 - parameter usingEqualQueryConstraint: Use the **$eq** query constraint when querying.
94+ - parameter usingPostForQuery: Use **POST** instead of **GET** when making query calls.
95+ Defaults to **false**.
8896 - parameter keyValueStore: A key/value store that conforms to the `ParseKeyValueStore`
8997 protocol. Defaults to `nil` in which one will be created an memory, but never persisted. For Linux, this
9098 this is the only store available since there is no Keychain. Linux users should replace this store with an
@@ -110,6 +118,7 @@ public struct ParseConfiguration {
110118 See Apple's [documentation](https://developer.apple.com/documentation/foundation/urlsessiontaskdelegate/1411595-urlsession) for more for details.
111119 - warning: `usingTransactions` is experimental.
112120 - warning: It is recomended to only specify `masterKey` when using the SDK on a server. Do not use this key on the client.
121+ - warning: Setting `usingPostForQuery` to **true** will require all queries to access the server instead of following the `requestCachePolicy`.
113122 */
114123 public init ( applicationId: String ,
115124 clientKey: String ? = nil ,
@@ -121,6 +130,7 @@ public struct ParseConfiguration {
121130 allowingCustomObjectIds: Bool = false ,
122131 usingTransactions: Bool = false ,
123132 usingEqualQueryConstraint: Bool = false ,
133+ usingPostForQuery: Bool = false ,
124134 keyValueStore: ParseKeyValueStore ? = nil ,
125135 requestCachePolicy: URLRequest . CachePolicy = . useProtocolCachePolicy,
126136 cacheMemoryCapacity: Int = 512_000 ,
@@ -140,6 +150,7 @@ public struct ParseConfiguration {
140150 self . isAllowingCustomObjectIds = allowingCustomObjectIds
141151 self . isUsingTransactions = usingTransactions
142152 self . isUsingEqualQueryConstraint = usingEqualQueryConstraint
153+ self . isUsingPostForQuery = usingPostForQuery
143154 self . mountPath = " / " + serverURL. pathComponents
144155 . filter { $0 != " / " }
145156 . joined ( separator: " / " )
@@ -253,6 +264,8 @@ public struct ParseSwift {
253264 side for each object. Must be enabled on the server to work.
254265 - parameter usingTransactions: Use transactions when saving/updating multiple objects.
255266 - parameter usingEqualQueryConstraint: Use the **$eq** query constraint when querying.
267+ - parameter usingPostForQuery: Use **POST** instead of **GET** when making query calls.
268+ Defaults to **false**.
256269 - parameter keyValueStore: A key/value store that conforms to the `ParseKeyValueStore`
257270 protocol. Defaults to `nil` in which one will be created an memory, but never persisted. For Linux, this
258271 this is the only store available since there is no Keychain. Linux users should replace this store with an
@@ -276,6 +289,7 @@ public struct ParseSwift {
276289 See Apple's [documentation](https://developer.apple.com/documentation/foundation/urlsessiontaskdelegate/1411595-urlsession) for more for details.
277290 - warning: `usingTransactions` is experimental.
278291 - warning: It is recomended to only specify `masterKey` when using the SDK on a server. Do not use this key on the client.
292+ - warning: Setting `usingPostForQuery` to **true** will require all queries to access the server instead of following the `requestCachePolicy`.
279293 */
280294 static public func initialize(
281295 applicationId: String ,
@@ -286,6 +300,7 @@ public struct ParseSwift {
286300 allowingCustomObjectIds: Bool = false ,
287301 usingTransactions: Bool = false ,
288302 usingEqualQueryConstraint: Bool = false ,
303+ usingPostForQuery: Bool = false ,
289304 keyValueStore: ParseKeyValueStore ? = nil ,
290305 requestCachePolicy: URLRequest . CachePolicy = . useProtocolCachePolicy,
291306 cacheMemoryCapacity: Int = 512_000 ,
@@ -306,6 +321,7 @@ public struct ParseSwift {
306321 allowingCustomObjectIds: allowingCustomObjectIds,
307322 usingTransactions: usingTransactions,
308323 usingEqualQueryConstraint: usingEqualQueryConstraint,
324+ usingPostForQuery: usingPostForQuery,
309325 keyValueStore: keyValueStore,
310326 requestCachePolicy: requestCachePolicy,
311327 cacheMemoryCapacity: cacheMemoryCapacity,
@@ -325,6 +341,7 @@ public struct ParseSwift {
325341 allowingCustomObjectIds: Bool = false ,
326342 usingTransactions: Bool = false ,
327343 usingEqualQueryConstraint: Bool = false ,
344+ usingPostForQuery: Bool = false ,
328345 keyValueStore: ParseKeyValueStore ? = nil ,
329346 requestCachePolicy: URLRequest . CachePolicy = . useProtocolCachePolicy,
330347 cacheMemoryCapacity: Int = 512_000 ,
@@ -345,6 +362,7 @@ public struct ParseSwift {
345362 allowingCustomObjectIds: allowingCustomObjectIds,
346363 usingTransactions: usingTransactions,
347364 usingEqualQueryConstraint: usingEqualQueryConstraint,
365+ usingPostForQuery: usingPostForQuery,
348366 keyValueStore: keyValueStore,
349367 requestCachePolicy: requestCachePolicy,
350368 cacheMemoryCapacity: cacheMemoryCapacity,
0 commit comments