nsurlrequest Questions

2

Solved

How to convert URL Request to cURL? I know there are plugins available in Alamofire / Moya. But I'm using native code. Here is how I'm generating URLRequest. var urlRequest = URLRequest(url: ...
Duodecillion asked 17/5, 2020 at 17:14

10

Solved

How To check response.statusCode in SendSynchronousRequest in Swift The Code is Below : let urlPath: String = "URL_IS_HERE" var url: NSURL = NSURL(string: urlPath) var request: NSURLRequest = NSUR...
Velutinous asked 4/10, 2014 at 9:18

8

Solved

I'm very new to swift, so I will probably have a lot of faults in my code but what I'm trying to achieve is send a GET request to a localhost server with paramters. More so I'm trying to achieve it...
Apriorism asked 31/12, 2014 at 16:48

5

Solved

I wan't to check if my url statusCode equals to 200, I created a function returning a Boolean if the statusCode equals to 200, I'm using a dataTask, but I don't know how to return a value: c...
Senescent asked 13/10, 2016 at 7:29

4

I'm setting up a webview but I need to load the content of the webview using a proxy. Any of you knows how can I'm implement the proxy in NSURLRequest? for example: NSString *location=@"http://g...
Gurgitation asked 31/5, 2013 at 0:8

5

I want to set cookies in my HTTP POST request. Something like the cookie field in the HTTP Request below, version: 0.1.7 Cookie: client=Android; version=0.1.7; sellerId=SEL5483318784; key=178a050...
Nurserymaid asked 12/10, 2015 at 14:6

5

Solved

I've an extremely weird problem, I'm requesting a URL and I want to get the cookies from it, I've used this way to get the cookies: - (void)connection:(NSURLConnection *)connection didReceiveRespo...
Largely asked 28/9, 2013 at 11:46

11

Solved

If I run this request from my terminal I can see the JSON requests as normally: curl -XGET 192.168.0.6:8888/scripts/data/backend2/index.php/name/_all My code for the NSURlRequest is this: NSUR...
Selfwill asked 29/11, 2013 at 22:45

2

Solved

In this example I kick off 100 NSURLSessionDataTask at default priority but then set the last one to high priority. However it seems to have no effect at all as the last task still ends up running ...
Reverse asked 1/6, 2016 at 6:56

3

Solved

Anyone knows why am I getting fatal error: unexpectedly found nil while unwrapping an Optional value When i use let URL = NSURL(string: "https://roads.googleapis.com/v1/snapToRoads?path=-35.278...
Hannus asked 5/3, 2015 at 16:35

2

Solved

I had a problem, I use the iGDB REST API which need to send some plain text for some endpoints with GET method. There is no problem with PostMan (by selecting "Body" > "raw" & paste my query),...
Essy asked 2/10, 2019 at 13:10

4

Solved

I want to be able to send some extra headers with my UIWebView loadRequest method. I have tried: NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.r...
Schalles asked 11/10, 2012 at 16:48

1

I'm having the same problem as: NSURL with special characters But tried their solution. Can't get my NSURLRequest to work with åöä characters. If the variable "string" contains åöä the request ret...
Backstop asked 26/6, 2014 at 7:20

4

Solved

I recently had a problem when comparing two NSURLs and compare one NSURL with an NSString(which is a URL address), the situation is I got an NSURLRequest from somewhere, I may or may not know the U...
Villasenor asked 7/9, 2012 at 0:33

1

Solved

I would like to use a WKWebView (not a UIWebView) and load some html files in it. I precise that I put the ArbitraryLoads to YES in info.plist. (For info, it works on simulator but not on device)....
Occultism asked 23/10, 2018 at 12:23

3

Solved

How can I change in my WebView the default string of User-Agent? @IBOutlet weak var myWbView: UIWebView! let myURL = NSURL(string: "http://http://web-example") let myURLRequest:NSURLRequest = NSUR...
Hopehopeful asked 27/4, 2016 at 12:34

3

Solved

I am using Xcode 6 for an iOS App with Swift. I have got a simple ViewController with an embedded UIWebView. You can find the code below. Now I want to change the User-Agent HTTP header. I tried to...
Puss asked 6/10, 2014 at 15:50

0

I want to use HTTP request to post an image on Imgur. I used Postman first to make sure my API logic is correct. Here is my setting for Postman (myid is client id): This request succeeded, but...
Isidore asked 9/2, 2018 at 22:24

7

Solved

I want to do a POST request to my WKWebView but the headers doesn't get set when I monitor the requests with Charles so the request fails. What is wrong here? NSString *post = [NSString stringWith...

2

Solved

I'm looking through some swift documents and I see that NSURLRequest and URLRequest are practically the same, with the added tidbit that NSURLRequest is used: when you need reference semantics o...
Artifice asked 27/6, 2017 at 0:46

2

I'm trying to set a client-side timeout per request for Alamofire for Swift. The lead architect told me to set this on NSURLRequest, but I'm completely confused on how to actually do that in practi...
Inkberry asked 25/11, 2014 at 20:8

4

Solved

I have a web API that, for a specific request returns status code 200 if everything went ok, and 401 if the user is not logged in based on an Authorization token. Everything works fine if the respo...
Sentinel asked 1/4, 2015 at 13:17

3

I am trying to follow this tutorial and connect to a JSON api using Swift and NSURLConnection. I can see that it is hitting the url but the connectionDidFinishLoading does not seem to fire. impor...
Romanfleuve asked 12/6, 2014 at 4:18

8

Solved

I am trying to establish a HTTPS connection to a server using my app. But the connection fails due to following error Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a se...
Ellsworth asked 18/2, 2011 at 11:7

3

For some reason i can't upload a jpeg file to a server using the post method in NSURLRequest I have an android app that uses the same php code and can upload and download images fine by converting...
Pleomorphism asked 8/3, 2013 at 5:8

© 2022 - 2024 — McMap. All rights reserved.