Note that there are some explanatory texts on larger screens.

plurals
  1. PObigcommerce api on iphone
    text
    copied!<p>i am using bigcommerce api in iphone to fetch data from that so i am doing it with the help of xml parsing but to get the list of orders it is asking for the login into bigcommerce website and then parse the data if anyone help me in this then i will be very thankful , please tell me through xml parsing how we can send login credentials and then hit on the url to parse data.....</p> <p>thankyou </p> <p>i am writing this code</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Add the navigation controller's view to the window and display. [self.window addSubview:navigationController.view]; [self.window makeKeyAndVisible]; // Override point for customization after application launch. NSString *string=[NSString stringWithFormat:@"https://www.labradorhometraining.com/api/v2"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:string]]; // NSString *dataString = [NSString stringWithFormat:@"{\"screenName\":\"%@\",\"password\":\"%@\",\"pushToken\":\"%@\",\"deviceType\":\"%@\"}", Screentxtf.text,passtxtf.text, str, deviceType]; [request setRequestMethod:@"GET"]; [request appendPostData:[string dataUsingEncoding:NSUTF8StringEncoding]]; // Basic YWRtaW46cGFzc3dvcmQ= [request addRequestHeader:@"Content-Type" value:@"application/xml"]; [request addRequestHeader:@"Authorization: Basic ZGVtb2tleTpkZW1vdG9rZW4= " value:[NSString stringWithFormat:@"%@ %@",@"api", @"c275ab4076f87"]]; [request setUseSessionPersistence:NO]; [request setUseCookiePersistence:NO]; [request setCacheStoragePolicy:ASICacheForSessionDurationCacheStoragePolicy]; [request setDelegate:self]; [request startAsynchronous]; return YES; } </code></pre> <p>and this is in root view controller</p> <pre><code>-(void)gototselect{ NSString *string=[NSString stringWithFormat:@"https://www.labradorhometraining.com/api/v2/orders.xml"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:string]]; // NSString *dataString = [NSString stringWithFormat:@"{\"screenName\":\"%@\",\"password\":\"%@\",\"pushToken\":\"%@\",\"deviceType\":\"%@\"}", Screentxtf.text,passtxtf.text, str, deviceType]; [request setRequestMethod:@"PUT"]; // [request appendPostData:[string dataUsingEncoding:NSUTF8StringEncoding]]; [request addRequestHeader:@"Authorization" value:[NSString stringWithFormat:@"%@ %@",@"api", @"c2714076f87"]]; [request allowCompressedResponse]; [request setUseSessionPersistence:NO]; [request setUseCookiePersistence:NO]; [request setCacheStoragePolicy:ASICacheForSessionDurationCacheStoragePolicy]; [request setDelegate:self]; [request startAsynchronous]; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload