Может ли кто-нибудь помочь мне в поиске решения этой проблемы?загруженный контент iws> 2500 байт, но при преобразовании nsstring возвращает пустое.
NSMutableString *postString = [NSMutableString string];
// NSMutableString *postString = [[NSMutableString alloc] init];
[postString appendFormat:@"username=%@",[strUsrName dataUsingEncoding:NSUTF8StringEncoding]];
[postString appendFormat:@"&password=%@",[strPasswrd dataUsingEncoding:NSUTF8StringEncoding]];
[postString appendFormat:@"&client_assertion_type=%@",[@"JWT"dataUsingEncoding:NSUTF8StringEncoding]];
[postString appendFormat:@"&client_assertion=%@",[strAppTknContent dataUsingEncoding:NSUTF8StringEncoding]];
[postString appendFormat:@"&spEntityID=%@",[@"http://localhost:8080/opensso"dataUsingEncoding:NSUTF8StringEncoding]] ;
NSHTTPURLResponse *response = nil;
NSError *error = nil;
NSMutableURLRequest *theRequest = [[NSMutableURLRequest alloc] initWithURL:nsurl];
NSData* dataRequest = [postString dataUsingEncoding: NSISOLatin1StringEncoding ];
// NSData* dataRequest = [NSData dataWithBytes:strRequest];
[theRequest setHTTPMethod: @"POST"];
[theRequest setHTTPBody: dataRequest];
[theRequest setURL:nsurl];
//// set headers
NSString *contentType = [NSString stringWithFormat:@"text/plain"];
[theRequest setValue:contentType forHTTPHeaderField:@"Content-Type"];
NSString *acceptType = [NSString stringWithFormat:@"application/json"];
[theRequest setValue:acceptType forHTTPHeaderField:@"accept"];
[theRequest setTimeoutInterval:3.0];
[theRequest setCachePolicy:NSURLRequestReturnCacheDataElseLoad];
NSData *responseData =[NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];
NSString *strUserResponse =[[NSString alloc]initWithData:responseData encoding:NSISOLatin1StringEncoding];
int status =[response statusCode ] ;
staus: 204, но strUserResponse пусто