Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6783823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:55:02+00:00 2026-05-26T16:55:02+00:00

I am trying to access the XML http://webservices.ns.nl/ns-api-stations using ASIHTTPRequest. But what I am

  • 0

I am trying to access the XML http://webservices.ns.nl/ns-api-stations using ASIHTTPRequest. But what I am using now doesn’t seem to work. It says the host is not reachable. So I assume it is going wrong at the ASIHTTPRequest part?

-(void)fetchStationData {
//Method for the fetching of the data

//First lets check wheater there is an internet connection and if the host is reachable
if(internetActive) {

    //Internet is active

    //Init the parser
    parser = [[RSSParser alloc] init];

    //Set he parser context
    parser.context = context;

    //The array to het the data from 


     NSURL *url = [NSURL URLWithString:@"http://webservices.ns.nl/ns-api-stations"];
     ASIHTTPRequest *requestaccount = [ASIHTTPRequest requestWithURL:url];
     [requestaccount setUsername:@"user"];
     [requestaccount setPassword:@"password"];
    //The XML elements to fetch
    NSArray *elements = [[NSArray alloc] initWithObjects:@"name",nil];
    //The actual fetchin
    [parser fetchStationItemsForUrl:url forElements:elements];

    //Save the context ?
    [context save:nil];

    //Clean up
    [elements release]; 

}else{

    //Internet is down  :( 
    //Offline artikelen inladen

    //Dit uitvoeren op de main que
    dispatch_async(dispatch_get_main_queue(), ^ {

        UIAlertView *Notpermitted = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Er is geen verbinding mogelijk met de Mezz. Offline artikelen zijn ingeladen." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];

        [Notpermitted show];
        [Notpermitted release];

    });

}

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:55:02+00:00Added an answer on May 26, 2026 at 4:55 pm

    Use ASIFormDataRequest.

    NSURL *url = [NSURL URLWithString:@"http://webservices.ns.nl/ns-api-stations"];
    ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
    [request addPostValue:@"accountname" forKey:@"username"];
    [request addPostValue:@"password" forKey:@"password"];
    
    [request setCompletionBlock:^ {
      // do something when request succeeds and credentials are ok, e.g. redirect user to the home page
    }];
    
    [request setFailedBlock:^ {
      // notify user that request failed
    }];
    
    [request startAsynchronous];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to parse the xml response of http://api.hostip.info/?ip=12.215.42.19 with SimpleXML but I can't
I'm trying to access an xml file over http. The address is similar to:
I'm trying to use Javascript to access data from http://www.bart.gov/dev/eta/bart_eta.xml , however, I found
I'm trying to access list data using SSRS 2008. I have created an XML
I am trying to build a C++ app to access a XML resource. Using
I am trying to access some basic info from an XML based API. I'm
I am trying to access the google calendar using gdata. but the application closes
I've been trying to access some XML, which looks like this: <feed xmlns:s=http://syndication.nhschoices.nhs.uk/services xmlns=http://www.w3.org/2005/Atom>
I have a basecamp account which I'm trying to access via its XML API.
I've been trying to access the NHS API using different methods to read in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.