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

  • Home
  • SEARCH
  • 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 6159695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:10:34+00:00 2026-05-23T21:10:34+00:00

I am trying to get data from WebService for my Ipad App. To do

  • 0

I am trying to get data from WebService for my Ipad App.

To do that, I am using a NSURLConnection with NSMutableURLRequest.

Web Services are published on Apache-Coyote 1.1 with Preemptive Basic Authentication, but I don’t know how to send my credentials from Objective-C.

Anybody knows how can I set my user/password in Objective-C to log my clients with the Apache premptive authentication system?

Thank you.

  • 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-23T21:10:34+00:00Added an answer on May 23, 2026 at 9:10 pm

    EDIT:

    In order to set the creds yourself, you’ll need to be able to base64 encode the username and password and set the appropriate header. Matt Gallagher, from Cocoa With Love, has a great post on how to add a category to NSData to easily do this.

    NSString* username = @"username";
    NSString* password = @"password";
    
    NSString* encodedUsername = [[username dataUsingEncoding:NSUTF8StringEncoding] base64EncodedString];
    NSString* encodedPassword = [[password dataUsingEncoding:NSUTF8StringEncoding] base64EncodedString];
    
    NSURL* url = [NSURL URLWithString:@"http://yourUrl.com/"];
    NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:url];
    NSString* headerValue = [NSString stringWithFormat:@"Basic %@:%@", encodedUsername, encodedPassowrd];
    [request addValue:@"Authorization" forHTTPHeaderField:headerValue];
    
    [NSURLConnection connectionWithRequest:request delegate:self];
    

    As with all use of credentials, please make sure you are doing this all over HTTPS because these credentials are essentially being passed in clear text.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use jQuery to get data from an ASP.NET web service (SharePoint
I'm trying to get character data from www.wowarmory.com using PHP and cURL. The code
for example I'm trying to get the data from database like: using (ExplorerDataContext context
I have an IPhone app that uses webservices to get data from a server.
When trying to get some data on my android client from my webservice (running
I am trying to connect my iOS app to a GET data from my
I'm trying to retrieve list data from a Sharepoint 2010 server using the webservice
I was trying to invoke a webservice from phonegap android app using jQuery .ajax
I am trying to get data from my interface, written in c, to another
What is the best way of handling trying to get data from a DataReader

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.