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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:50:07+00:00 2026-05-11T16:50:07+00:00

I am sending a post using NSURLRequest. NSURL *url = [NSURL URLWithString:someUrlString]; NSMutableURLRequest *theRequest

  • 0

I am sending a post using NSURLRequest.

NSURL *url = [NSURL URLWithString:someUrlString];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
NSString *msgLength = [NSString stringWithFormat:@"%d", [parameterString length]];
[theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody: [parameterString dataUsingEncoding:NSUTF8StringEncoding]];

Within the body of the Request I am encoding the following NVP:

returnURL=http://someSite.com

The post is going through successfully, but I get an error back.
The error states an invalid url.

So, I changed it to:

returnURL=http:%2F%2FsomeSite.com

With the same error.

I have also double checked it with Todd Ditchendorf’s HTTP Client, with the same results.

I know I must be encoding this wrong can someone tell me what I am doing wrong?

Thanks
Corey

**UPDATE:
Thanks to those who answered. I missed an ampersand in my NVP values. So of course, as soon as I fixed it, everything was fine. What I suspectede, the encoding of a url in the body of the post was incorrect. I am not using the ASIHTTPRequest framework, but it did help me troubleshoot the problem (overkill for what I needed).
**

  • 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-11T16:50:07+00:00Added an answer on May 11, 2026 at 4:50 pm

    Consider using Ben Copsey’s ASIHTTPRequest framework for generating and sending synchronous and asynchronous HTTTP requests (POST and GET):

    ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:@"http://someSite.com"] autorelease];
    [request setPostValue:@"myValue1" forKey:@"myFormField1"];
    [request setPostValue:@"myValue2" forKey:@"myFormField2"];
    // etc.
    [request start];
    NSError *error = [request error];
    if (!error)
      NSString *response = [request responseString];
    

    His framework is a huge time-saver.

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

Sidebar

Ask A Question

Stats

  • Questions 204k
  • Answers 204k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer No, your mapping is fine as is. May 12, 2026 at 8:45 pm
  • Editorial Team
    Editorial Team added an answer If the aim is to count the number of SpecialArticles… May 12, 2026 at 8:45 pm
  • Editorial Team
    Editorial Team added an answer From wikipedia: ... 2-satisfiability can be solved in polynomial time.… May 12, 2026 at 8:45 pm

Related Questions

I am trying to use Twitter OAuth and my POST requests are failing with
How can I sanitize URLs made from strings to replace characters like space to
Sorry, another super basic ASP.NET question. this so embarrassing. I am reading the article
When using TempData, my understanding is that it will keep whatever you put in

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.