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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:42:15+00:00 2026-06-15T23:42:15+00:00

I am calling the following URL from my iPhone app NSString *resourcePath = [NSString

  • 0

I am calling the following URL from my iPhone app

NSString *resourcePath = [NSString stringWithFormat:@"/sm/search?limit=100&term=%@&types[]=users&types[]=questions", searchTerm];

However, when the server call is made, I found that the actual URL sent was this

/sm/search?term=mi&types%5B%5D=questions&limit=100

How can I resolve this so that the correct URL is sent to the server?

  • 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-15T23:42:16+00:00Added an answer on June 15, 2026 at 11:42 pm

    I assume that you use the NSURL method

    initWithScheme:host:path:
    

    to create the URL. According to the documentation, this method automatically escapes path with the stringByAddingPercentEscapesUsingEncoding: method.

    The square brackets are escaped, because they are “unsafe” in the sense of RFC 1738 – Uniform Resource Locators (URL):

    Characters can be unsafe for a number of reasons. […] Other characters
    are unsafe because gateways and other transport agents are known to
    sometimes modify such characters. These characters are “{“, “}”,
    “|”, “\”, “^”, “~”, “[“, “]”, and “`”.

    All unsafe characters must always be encoded within a URL.

    If you create the URL with

    NSString *s = [NSString stringWithFormat:@"http://server.domain.com/sm/search?limit=100&term=%@&types[]=users&types[]=questions", searchTerm];
    NSURL *url = [[NSURL alloc] initWithString:s];
    

    then no escape sequences are added, because initWithString expects the string to contain any necessary percent escape codes.

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

Sidebar

Related Questions

I'm calling the following URL using YQL http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22UTG.L%22)%0A%09%09&format=json&env=http%3A%2F%2Fdatatables.org%2Falltables.env&callback=cbfunc this returns the following in JSON
I would like to use the data you get when calling the following URL
I'm running matlab on my local machine and I'm calling the following function from
Currently I'm working on calling a JSON feed (from an URL) from within an
Hi I am getting the following invalid liscence exception while calling a secured URL
Im developing an IOS 5 app which takes a feed from a url and
I am a iPhone developer. I know that we can open iphone app from
I have a WordPress site which I am calling a URL from a custom
I've got the following to open up a browser from within an Android app.
My Code works fine when calling REST URL: http://api.feedzilla.com/v1/categories.json but when I call following

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.