Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Background configuration type #204

Closed
SalvatoreAD opened this issue Sep 6, 2017 · 6 comments
Closed

.Background configuration type #204

SalvatoreAD opened this issue Sep 6, 2017 · 6 comments

Comments

@SalvatoreAD
Copy link

Hi, I'm trying to make POST requests in multipart in the background, but I get this error:

Completion handler blocks are not supported in background sessions. Use a delegate instead.

Can you give me an example to use background type request?

Thanks

@3lvis
Copy link
Owner

3lvis commented Sep 6, 2017

Hi @SalvatoreAD,

For post request in the background, I would recommend you to use Alamofire. Networking is not well optimized for background uploads. I tried looking into it some time ago and figured is outside of its main purpose which is to provide a simple interface to GET, PUT, POST and DELETE requests.

@SalvatoreAD
Copy link
Author

SalvatoreAD commented Sep 6, 2017

Hi @3lvis I tried Alamofire, but I can not make a upload, while with this library I have succeeded. Can you explain how to use the ".background" configuration?

@3lvis
Copy link
Owner

3lvis commented Sep 6, 2017

This is what I used as a guide when I tried to implement this feature. https://github.com/nevyn/URLSessionTest

@3lvis
Copy link
Owner

3lvis commented Sep 6, 2017

The difficult part was to support resuming downloads.

@SalvatoreAD
Copy link
Author

ok, How can I use this configuration in swift? Can you give me an example?

@3lvis
Copy link
Owner

3lvis commented Sep 6, 2017

@SalvatoreAD We don't have support for background uploads in Networking, check this project for a reference on how to implement this. https://github.com/nevyn/URLSessionTest

Sorry for not being more helpful now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants