Commit Graph

24 Commits

Author SHA1 Message Date
Vadim Zeitlin
1c61fe6baf Remove wxWebResponse::AsString() conversion parameter
It doesn't make much sense to specify the conversion here, it would
ideally be taken from the response Content-Type header itself and
currently is just assumed to be UTF-8 anyhow.

Also implement fallback to Latin-1 to avoid losing the data entirely if
it's not in UTF-8.
2020-12-13 01:16:41 +01:00
Vadim Zeitlin
700d6ddea6 Minor code formatting changes
No real changes at all, just improve layout, consistency etc.
2020-12-13 00:35:24 +01:00
Vadim Zeitlin
727b590814 Pass wxSharedPtr argument of RegisterFactory() by const reference
Avoid extra copies from passing it by value.
2020-12-13 00:19:03 +01:00
Vadim Zeitlin
64a3801160 Tweaks to wxWebRequest::SetData() overload taking stream
Check that the stream is valid, if specified at all, and return false if
it isn't -- or if no size was specified and determining stream size
failed.

Check for SetData() success in the test to provide better diagnostics in
case the file it uses is not found (as is the case when running the test
from another directory, for example).

Also pass wxSharedPtr<> by const reference instead of by value to avoid
unnecessary copies.
2020-12-12 18:46:28 +01:00
Tobias Taschner
2fa38b1d26 Remove incompatible Storage:: specifier 2018-12-10 19:38:06 +01:00
Tobias Taschner
7577c95aab Destroy default wxWebSession in module 2018-12-10 19:38:05 +01:00
Tobias Taschner
f04094e4ec Implement GetBytesReceived() in base class 2018-12-10 19:38:04 +01:00
Tobias Taschner
ab544da1d2 Move GetBytesExpectedToReceive() impl to base class 2018-12-10 19:38:03 +01:00
Cătălin Răceanu
2f4be7e1ae Update src/common/webrequest.cpp
Co-Authored-By: TcT2k <TcT2k@users.noreply.github.com>
2018-12-10 19:38:02 +01:00
Tobias Taschner
00623291ac Use Content-Disposition in GetSuggestedFileName() 2018-12-10 19:37:56 +01:00
Tobias Taschner
f40e2e64d9 Add wxWebRequest::SplitParameters method
This method is adapted for use in wxWidgets from the Poco library.
2018-12-10 19:37:55 +01:00
Tobias Taschner
56af6cbdee Implement Cancel for WinHTTP backend 2018-12-10 19:37:50 +01:00
Tobias Taschner
f64fbf0b4b Remove deprecated usage of wxRemove() 2018-12-10 19:37:45 +01:00
Tobias Taschner
22f1894266 Fix webrequest without precomp 2018-12-10 19:37:44 +01:00
Tobias Taschner
c24efa9821 Implement additional storage targets 2018-12-10 19:37:42 +01:00
Tobias Taschner
6530e3c08e Move response data handling to base class 2018-12-10 19:37:40 +01:00
Tobias Taschner
871049f1a1 Implement wxWebResponse::GetMimeType() and GetSuggestedFileName() 2018-12-10 19:37:37 +01:00
Tobias Taschner
03e9b1b549 Remove progress events 2018-12-10 19:37:35 +01:00
Tobias Taschner
4fd6091513 Implement WinHTTP authentication 2018-12-10 19:37:35 +01:00
Tobias Taschner
5f3dc058aa Prepare additional wxWebRequest backends 2018-12-10 19:37:33 +01:00
Tobias Taschner
701f697fa4 Change wxWebRequest API to use STATE event 2018-12-10 19:37:30 +01:00
Tobias Taschner
d7dee7019e Implement sending request data with wxWebRequest 2018-12-10 19:37:25 +01:00
Tobias Taschner
a4279752f8 Start wxWebRequestWinHTTP implementation
Can already run the GET request in the sample app
2018-12-10 19:37:23 +01:00
Tobias Taschner
e07c1bf40c Prepared wxWebRequest implementation 2018-12-10 19:37:21 +01:00