...
|
...
|
@@ -42,9 +42,8 @@ static NSString *const YH_HTTP_PREFIX = @"http://"; |
|
|
self.httpClient.securityPolicy.allowInvalidCertificates = YES;
|
|
|
self.httpClient.operationQueue.maxConcurrentOperationCount = 6;
|
|
|
[self.httpClient.requestSerializer setValue:@"gzip" forHTTPHeaderField:@"Content-Encoding"];
|
|
|
if ([[YH_Analytics sharedInstance].session length] > 0) {
|
|
|
[self.httpClient.requestSerializer setValue:[[YH_Analytics sharedInstance] session] forHTTPHeaderField:@"x-yoho-sid"];
|
|
|
}
|
|
|
|
|
|
self.baiduManager = [AFHTTPRequestOperationManager manager];
|
|
|
AFHTTPResponseSerializer *responseSerializer = [AFHTTPResponseSerializer serializer];
|
|
|
responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/json", @"text/plain", @"text/html", @"text/xml", nil];
|
...
|
...
|
@@ -62,6 +61,11 @@ static NSString *const YH_HTTP_PREFIX = @"http://"; |
|
|
self.httpClient = nil;
|
|
|
}
|
|
|
|
|
|
- (void)updateHttpClientRequestHTTPHeaderSid
|
|
|
{
|
|
|
[self.httpClient.requestSerializer setValue:[[YH_Analytics sharedInstance] session] forHTTPHeaderField:@"x-yoho-sid"];
|
|
|
}
|
|
|
|
|
|
- (NSString *)checkHttpsPrefix:(NSString *)urlString
|
|
|
{
|
|
|
urlString = [self urlStringByTransformToHttpsProtocol:urlString];//进行http->https的转换
|
...
|
...
|
@@ -122,6 +126,8 @@ static NSString *const YH_HTTP_PREFIX = @"http://"; |
|
|
|
|
|
NSString *url = [self checkHttpsPrefix:kURLAnalyticsService];
|
|
|
|
|
|
[self updateHttpClientRequestHTTPHeaderSid];
|
|
|
|
|
|
return [self.httpClient POST:url priority:NSOperationQueuePriorityLow parameters:newParameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
|
|
|
|
|
|
if (block) {
|
...
|
...
|
@@ -236,6 +242,8 @@ static NSString *const YH_HTTP_PREFIX = @"http://"; |
|
|
|
|
|
url = [self checkHttpsPrefix:url];
|
|
|
|
|
|
[self updateHttpClientRequestHTTPHeaderSid];
|
|
|
|
|
|
return [self.httpClient POST:url priority:NSOperationQueuePriorityLow parameters:newParameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
|
|
|
|
|
|
if (block) {
|
...
|
...
|
|