mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Tidied up some comments and usage of File::createOutputStream() and createInputStream()
This commit is contained in:
parent
81e206f963
commit
302019dd43
13 changed files with 114 additions and 87 deletions
|
|
@ -103,15 +103,16 @@ public:
|
|||
StringPairArray responseHeaders;
|
||||
int statusCode = 0;
|
||||
|
||||
std::unique_ptr<InputStream> stream (url.createInputStream (false, nullptr, nullptr, {},
|
||||
10000, // timeout in millisecs
|
||||
&responseHeaders, &statusCode));
|
||||
if (stream.get() != nullptr)
|
||||
if (auto stream = std::unique_ptr<InputStream> (url.createInputStream (false, nullptr, nullptr, {},
|
||||
10000, // timeout in millisecs
|
||||
&responseHeaders, &statusCode)))
|
||||
{
|
||||
return (statusCode != 0 ? "Status code: " + String (statusCode) + newLine : String())
|
||||
+ "Response headers: " + newLine
|
||||
+ responseHeaders.getDescription() + newLine
|
||||
+ "----------------------------------------------------" + newLine
|
||||
+ stream->readEntireStreamAsString();
|
||||
}
|
||||
|
||||
if (statusCode != 0)
|
||||
return "Failed to connect, status code = " + String (statusCode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue