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

Add Support for File Content HTTP Responses #23

Merged
merged 4 commits into from
Sep 11, 2018
Merged

Conversation

EvilDrW
Copy link
Contributor

@EvilDrW EvilDrW commented Sep 3, 2018

This PR uses some of the demo NanoHTTPD code to enable support for sending the contents of a file in the response to an HTTP request. It currently only provides this support for Android because I don't any Apple to develop or test an implementation for iOS.

@EvilDrW
Copy link
Contributor Author

EvilDrW commented Sep 9, 2018

actually this has a couple of small problems that i found during more extensive testing. i'm hoping to send an update to this PR sometime soon

avoids sending the file data in response to every single request issued after the one for the file.
@EvilDrW
Copy link
Contributor Author

EvilDrW commented Sep 10, 2018

alright, seems ok now, at least based on all the testing i know how to do.

@@ -73,6 +73,18 @@ The params have to look like this (there are not default values for the params!)
}
```

### sendFileResponse(responseObject, callbackSuccess, callbackError) (currently Android-only support)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are exporting exports.sendFile

I don't know if the name "sendFile" is really the right method name. It should be more like "retrieveFile" or "getFileByPath"...

@bykof bykof merged commit ef48071 into bykof:master Sep 11, 2018
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

Successfully merging this pull request may close these issues.

2 participants