Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: iPhone iOS
Hi I have a web service which is hosted at the url which starts with HTTPS
I am trying to post data to this url from IOS Iphone.
But not able to hit to server.
Do i need to Confirm security Certificates or anything.
Thanks for the help in advance.
 
FYI Below is the code.
 

url=@"https://dev-jayporec.netsolutions.in/apicallback/cart/makePayment";
    
    NSString *combinedDataStr = [NSString stringWithFormat:@"{\"Shipping\":{\"mode\":\"%@\",\"firstname\":\"%@\",\"lastname\":\"%@\",\"company\":\"%@\",\"street\":\"%@\",\"city\":\"%@\",\"region\":\"%@\",\"region_id\":\"%@\",\"postcode\":\"%@\",\"country_id\":\"%@\",\"telephone\":\"%@\",\"fax\":\"%@\",\"is_default_shipping\":\"%@\",\"is_default_billing\":\"%@\"},\"Billing\":{\"mode\":\"%@\",\"firstname\":\"%@\",\"lastname\":\"%@\",\"company\":\"%@\",\"street\":\"%@\",\"city\":\"%@\",\"region\":\"%@\",\"region_id\":\"%@\",\"postcode\":\"%@\",\"country_id\":\"%@\",\"telephone\":\"%@\",\"fax\":\"%@\",\"is_default_shipping\":\"%@\",\"is_default_billing\":\"%@\"},\"userId\":\"%@\",\"cartId\":\"%@\",\"cardToken\":\"%@\",\"isNew\":\"%@\",\"cc_exp_year\":\"%@\",\"cc_exp_month\":\"%@\",\"cc_type\":\"%@\",\"cc_number\":\"%@\",\"cc_exp_date\":\"%@\",\"cc_cid\":\"%@\",\"user_credit\":\"%@\"}",@"shipping",ShippingFirstName,ShippingLastName,@"",ShippingAddress,ShippingCity,ShippingState,ShippingRegionID,ShippingZipCode,ShippingCountry,@"000",@"",@"0",@"0",@"billing",BillingFirstName,BillingLastName,@"",BillingAddress,BillingCity,BillingState,BillingRegionID,BillingZipCode,BillingCountry,@"000",@"",@"0",@"0",UserID,CartID,CardToken,IsNew,ExpYear,ExpMonth,CCType,CCNo,CCNoExpDate,CCNoCVV,UserCredit];
 
NSMutableURLRequest *request =nil;
    if(!delegate)
        delegate =(AppDelegate *)[[UIApplication sharedApplication]delegate];
 
    NSString *req=[NSString stringWithFormat:@"%@/device/%@",recievedRequestURL,delegate.deviceType];
 
    request=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:req]];
 
    [request setHTTPMethod:requestType];
    [request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
    [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
 
    if([requestType isEqualToString:@"POST"])
    {
 
        NSData* requestData = [combinedDataStr dataUsingEncoding:NSUTF8StringEncoding];
        [request setHTTPBody: requestData];
        //NSLog(@"Request %@",request);
    }
 
A Normal HTTP request is working but not the HTTPS..
 

Regards.
Posted 1-Jul-12 22:39pm
Edited 2-Jul-12 19:27pm
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CPallini 365
1 Sergey Alexandrovich Kryukov 252
2 OriginalGriff 165
3 George Jonsson 159
4 Richard MacCutchan 110
0 OriginalGriff 6,344
1 Sergey Alexandrovich Kryukov 5,860
2 CPallini 5,135
3 George Jonsson 3,559
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 3 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100