NSDictionary+MNPQueryString.h
1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// NSDictionary+MNPQueryString.h
// SWAN
//
// Created by baidu on 2018/10/25.
// Copyright © 2018 baidu. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSDictionary (MNPQueryString)
/**
* Creating a URL query string from an NSDictionary.
*
* @example @{@"param1" : @"value1", @"param2" : @(YES), @"param3" : @(5)} ->
* @"?param1=value1¶m2=1¶m3=5"
* @return URL query stirng with `?` at the beginning.
*/
- (nullable NSString *)queryString;
/**
* Creating a URL query string from an NSDictionary without `?` at the beginning.
*
* @return URL query stirng without `?` at the beginning.
*/
- (nullable NSString *)queryStringWithoutQuestionMark;
/**
* Creating a URL query string from an NSDictionary. value and key without encode
*
* @example @{@"param1" : @"value1", @"param2" : @(YES), @"param3" : @(5)} ->
* @"?param1=value1¶m2=1¶m3=5"
* @return URL query stirng with `?` at the beginning.
*/
- (nullable NSString *)queryStringWithoutEncode;
@end
NS_ASSUME_NONNULL_END