Click here to Skip to main content
12,634,927 members (30,553 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: Mobile 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 23:39pm
Updated 2-Jul-12 20:27pm
v4

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161208.2 | Last Updated 3 Jul 2012
Copyright © CodeProject, 1999-2016
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