N
N
Neckvik2020-03-07 17:32:19
iOS
Neckvik, 2020-03-07 17:32:19

SWIFT API handling statusCode?

Faced with the fact that when I send a request via URLSession dataTask, if a 301 response comes, it automatically redirects it, and eventually shows the code 200 because it was redirected to the correct server.
The question is, is it possible to turn it off somehow (hypothetically)?
What codes does he still know how to process?

And a little not in him but) why the request can fall if you do not specify http or https in the url?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
one pavel, 2020-03-07
@onepavel

they write on the Internet that this method allows you to avoid the redirect
https://developer.apple.com/documentation/foundati...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question