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 8490673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:11:40+00:00 2026-06-10T22:11:40+00:00

I am using ASIFormDataRequest to post three values which are a url, a title

  • 0

I am using ASIFormDataRequest to post three values which are a url, a title and a summary. All of them works fine on simulator but its not working on device. Here are the code that I’m using:

- (IBAction)addLinkPressed:(UIButton *)sender {

    ASIFormDataRequest *loginRequest = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"http://MyWebsite.com/login.php"]];
    [loginRequest setRequestMethod:@"POST"];
    [loginRequest setPostValue:[[NSUserDefaults standardUserDefaults] objectForKey:@"defaultUsername"] forKey:@"username"];
    [loginRequest setPostValue:[[NSUserDefaults standardUserDefaults] objectForKey:@"defaultPassword"] forKey:@"password"];
    [loginRequest setUseKeychainPersistence:YES];
    [loginRequest setDelegate:self];

    [loginRequest setDidFinishSelector:@selector(requestLoginFinished:)];
    [loginRequest setDidFailSelector:@selector(requestLoginFailed:)];
    [loginRequest startSynchronous];



    NSString *strURL = @"http://MyWebsite.com/send_link.php";
    ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:strURL]];
    [request setDelegate:self];
    [request setPostValue:self.linkField.text forKey:@"url"];
    [request setPostValue:self.linkTitleField.text forKey:@"title"];
    [request setPostValue:self.linkSummaryField.text forKey:@"summary"];

    [request setDidFinishSelector:@selector(requestDone:)];
    [request setDidFailSelector:@selector(requestWentWrong:)];
    [request startAsynchronous];
}

Anybody can help me please!

  • 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-06-10T22:11:41+00:00Added an answer on June 10, 2026 at 10:11 pm

    First of all: ASIRequest is not anymore supported. It is known to be buggy in some cases and that bugs won’t be fixed.

    Second one, regarding your question, I see two places where error could occur (difference between simulator and device):

    1. Are you sure that on device [[NSUserDefaults standardUserDefaults] objectForKey:@"defaultUsername"] and [[NSUserDefaults standardUserDefaults] objectForKey:@"defaultPassword"] are set properly?

    2. On iOS simulator you have not got access to keychain so this setting ([loginRequest setUseKeychainPersistence:YES];) could cause problems on the device too.

    I advice to check NSUserDefaults and better use another one framework, i.e. RestKit

    EDITED:

    Example of using RestKit:

    [RKClient clientWithBaseURLString:@"http://example.com"];
    RKClient *rkclient = [RKClient sharedClient];
    RKParams *params = [RKParams paramsWithDictionary:[NSDictionary dictionaryWithObjectsAndKeys:
                                                       username, @"username",
                                                       password, @"password", nil]];
    [rkclient post:@"/profile" params:params delegate:self];
    
    // implement needed delegate methods
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ASIFormDataRequest to send http requests but they all go to the
i'm trying to use ASIFormDataRequest to send post request. But when I import the
When I POST some images to my server using: ASIFormDataRequest *request = [[ASIFormDataRequest alloc]
I am using ASIFormDataRequest to send a POST request and at the same time
I am using ASIFormDataRequest in my iphone project to post data to twitter api
I have an application which logs into an online site using POST form being
I am using ASIHttpRequest to POST user and pass to url that executes php
I am using ASIHTTPRequest 1.6.2 lib for all http transactions in IPhone. But i
I'm using ASIFormDataRequest to post data to a server, and I need to post
I try to send some values using ASIFormDataRequest. The problem is that even though

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.