Linked Questions
21 questions linked to/from Creating URL query parameters from NSDictionary objects in ObjectiveC
1 vote
0 answers
2k views
iOS How To Convert NSDictionary To URL QueryString In Simplest Way [duplicate]
How can I convert NSDictionary To URL QueryString in iOs ? for example : NSDictionary *params = @{@"a":@1, @"b":@2} NSString queryString = convert(params); // a=1&b=2
0 votes
0 answers
155 views
obj-c dictionary to url parameter string [duplicate]
Are there any built in methods (or really simple examples, not using libraries) that can turn a dictionary into a url parameter string (to be appended to url). I'm expecting something similar to the ...
1 vote
0 answers
29 views
passing Values in Url when the api has dictionary [duplicate]
This is my Api and i need to pass values for Passport number Expiry data and other fields i know to pass data when its just normal values. I am not sure how to pass data inside the Dictionary Passport ...
9 votes
1 answer
7k views
String won't url encode in iOS
I'm seriously having a brain fart here, but I can't figure out why this isn't encoding for the life of me. Been searching all over, and I can't even get the code samples to encode. Any ideas? ...
16 votes
3 answers
21k views
Is there any way to attach a NSDictionary of parameters to an NSURLRequest instead of manually making a string?
AFNetworking allows you to add an NSDictionary of parameters to a request, and it will append them to the request. So if I wanted to do a GET request with ?q=8&home=8888 I'd just making an ...
8 votes
3 answers
12k views
Sending array of dictionaries with alamofire
I have to send array of dictionaries via POST request. For example: materials: [[String, String]] = [ [ "material_id": 1, "qty": 10 ], [ "material_id": 2, "qty": 5 ] ] ...
5 votes
3 answers
6k views
How to escape ampersand in URL query?
I've looked everywhere, and haven't found a single definitive answer in iOS. I'm trying to escape ampersands in my URL queries, but stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet....
1 vote
2 answers
6k views
POST request in Objective-C
Searching the web for some method to send POST requests in Objective-C, I came up with some solutions. That's what I've got: responseData = [NSMutableData new]; NSURL *url = [NSURL URLWithString:@"...
4 votes
1 answer
3k views
How to add GET parameters to an ASIHttpRequest?
How can I add GET parameters to an ASIHttpRequest? I want to go from http://mysite.com/server to http://mysite.com/server?a=1&b=2 programmatically. I have all my parameters as key-value pairs in ...
1 vote
3 answers
4k views
Encoding string arguments for URLs
I created a method to build URLs for me. - (NSString *)urlFor:(NSString *)path arguments:(NSDictionary *)args { NSString *format = @"http://api.example.com/%@?version=2.0.1"; NSMutableString *...
6 votes
2 answers
2k views
POST with URL parameters and JSON body in AFNetworking
I'd like to make a POST call that has both URL parameters and a JSON body: URL http://example.com/register?apikey=mykey JSON { "field" : "value"} How can I use two different serializers at the same ...
2 votes
2 answers
1k views
Stuck converting an NSDictionary to a POST string
So I'm trying to do an async POST request to my server from my iOS device. Here's the Swift code I've written: var urlString = "https://eamorr.com/ajax/login.php" var url = NSURL(string: ...
0 votes
2 answers
2k views
how to map the dictionaries keys and values(string/array) to one string in swift
I got an dictionary which looks like: ["foo": "whatever", "this": "that", "category": ["cat1", "cat2"]] and I need it to be a string like: foo=whatever&this=that&category=cat1&category=...
0 votes
1 answer
1k views
Getting UITableView to populate with data from another class
I am quite new to Objective-C and this is the first time I have attempted to implement MVC. I have a model class where l have an NSArray which will be populated with data from a JSON object. I want to ...
1 vote
1 answer
519 views
Unsupported URL when sending Json value as argument in GET method
Code: arrValues = [[NSMutableArray alloc]initWithObjects:@"Chennai", nil]; arrKeys = [[NSMutableArray alloc]initWithObjects:@"loc", nil]; dicValue = [NSDictionary ...