Loading...
Searching...
No Matches
juce::URL::InputStreamOptions Class Reference

`#include <juce_URL.h>`

## Public Member Functions

| InputStreamOptions (ParameterHandling parameterHandling)
InputStreamOptions | withProgressCallback (std::function< bool(int bytesSent, int totalBytes)> progressCallback) const
InputStreamOptions | withExtraHeaders (const String &extraHeaders) const
InputStreamOptions | withConnectionTimeoutMs (int connectionTimeoutMs) const
InputStreamOptions | withResponseHeaders (StringPairArray *responseHeaders) const
InputStreamOptions | withStatusCode (int *statusCode) const
InputStreamOptions | withNumRedirectsToFollow (int numRedirectsToFollow) const
InputStreamOptions | withHttpRequestCmd (const String &httpRequestCmd) const
ParameterHandling | getParameterHandling () const noexcept
std::function< bool(int, int)> | getProgressCallback () const noexcept
String | getExtraHeaders () const noexcept
int | getConnectionTimeoutMs () const noexcept
StringPairArray * | getResponseHeaders () const noexcept
int * | getStatusCode () const noexcept
int | getNumRedirectsToFollow () const noexcept
String | getHttpRequestCmd () const noexcept

## Detailed Description

Class used to create a set of options to pass to the createInputStream() method.

You can chain together a series of calls to this class's methods to create a set of whatever options you want to specify, e.g.

if (auto inputStream = URL ("http://www.xyz.com/foobar")
.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress)
.withConnectionTimeoutMs (1000)
.withNumRedirectsToFollow (0)))
{
...
}
juce::URL::InputStreamOptions
Definition juce_URL.h:331
juce::URL::InputStreamOptions::withNumRedirectsToFollow
InputStreamOptions withNumRedirectsToFollow(int numRedirectsToFollow) const
Definition juce_URL.cpp:724
juce::URL::InputStreamOptions::withConnectionTimeoutMs
InputStreamOptions withConnectionTimeoutMs(int connectionTimeoutMs) const
Definition juce_URL.cpp:709
juce::URL::createInputStream
std::unique_ptr< InputStream > createInputStream(const InputStreamOptions &options) const
Definition juce_URL.cpp:735
juce::URL::URL
URL()
Definition juce_URL.cpp:138

Definition at line 330 of file juce_URL.h.

## Constructor & Destructor Documentation

## InputStreamOptions()

juce::URL::InputStreamOptions::InputStreamOptions | ( | ParameterHandling | parameterHandling | ) |

explicit

Constructor.

If parameterHandling is ParameterHandling::inPostData, any URL parameters that have been set will be transferred via the request body data. Otherwise the parameters will be added to the URL address.

Definition at line 697 of file juce_URL.cpp.

## Member Function Documentation

## getConnectionTimeoutMs()

int juce::URL::InputStreamOptions::getConnectionTimeoutMs | ( |  | ) | const

inline noexcept

Definition at line 390 of file juce_URL.h.

## getExtraHeaders()

String juce::URL::InputStreamOptions::getExtraHeaders | ( |  | ) | const

inline noexcept

Definition at line 389 of file juce_URL.h.

## getHttpRequestCmd()

String juce::URL::InputStreamOptions::getHttpRequestCmd | ( |  | ) | const

inline noexcept

Definition at line 394 of file juce_URL.h.

## getNumRedirectsToFollow()

int juce::URL::InputStreamOptions::getNumRedirectsToFollow | ( |  | ) | const

inline noexcept

Definition at line 393 of file juce_URL.h.

## getParameterHandling()

ParameterHandling juce::URL::InputStreamOptions::getParameterHandling | ( |  | ) | const

inline noexcept

Definition at line 387 of file juce_URL.h.

## getProgressCallback()

std::function< bool(int, int)> juce::URL::InputStreamOptions::getProgressCallback | ( |  | ) | const

inline noexcept

Definition at line 388 of file juce_URL.h.

## getResponseHeaders()

StringPairArray * juce::URL::InputStreamOptions::getResponseHeaders | ( |  | ) | const

inline noexcept

Definition at line 391 of file juce_URL.h.

## getStatusCode()

int * juce::URL::InputStreamOptions::getStatusCode | ( |  | ) | const

inline noexcept

Definition at line 392 of file juce_URL.h.

## withConnectionTimeoutMs()

URL::InputStreamOptions juce::URL::InputStreamOptions::withConnectionTimeoutMs | ( | int | connectionTimeoutMs | ) | const

nodiscard

Specifies a timeout for the request in milliseconds.

If 0, this will use whatever default setting the OS chooses. If a negative number, it will be infinite.

Definition at line 709 of file juce_URL.cpp.

## withExtraHeaders()

URL::InputStreamOptions juce::URL::InputStreamOptions::withExtraHeaders | ( | const String & | extraHeaders | ) | const

nodiscard

A string that will be appended onto the headers that are used for the request.

It must be a valid set of HTML header directives, separated by newlines.

Definition at line 704 of file juce_URL.cpp.

## withHttpRequestCmd()

URL::InputStreamOptions juce::URL::InputStreamOptions::withHttpRequestCmd | ( | const String & | httpRequestCmd | ) | const

nodiscard

Specifies which HTTP request command to use.

If this is not set, then the command will be POST if parameterHandling is set to ParameterHandling::inPostData or if any POST data has been specified via withPOSTData(), withFileToUpload(), or withDataToUpload(). Otherwise it will be GET.

Definition at line 729 of file juce_URL.cpp.

## withNumRedirectsToFollow()

URL::InputStreamOptions juce::URL::InputStreamOptions::withNumRedirectsToFollow | ( | int | numRedirectsToFollow | ) | const

nodiscard

Specifies the number of redirects that will be followed before returning a response.

N.B. This will be ignored on Android which follows up to 5 redirects.

Definition at line 724 of file juce_URL.cpp.

## withProgressCallback()

URL::InputStreamOptions juce::URL::InputStreamOptions::withProgressCallback | ( | std::function< bool(int bytesSent, int totalBytes)> | progressCallback | ) | const

nodiscard

A callback function to keep track of the operation's progress.

This can be useful for lengthy POST operations, so that you can provide user feedback.

Definition at line 699 of file juce_URL.cpp.

## withResponseHeaders()

URL::InputStreamOptions juce::URL::InputStreamOptions::withResponseHeaders | ( | StringPairArray * | responseHeaders | ) | const

nodiscard

If this is non-null, all the (key, value) pairs received as headers in the response will be stored in this array.

Definition at line 714 of file juce_URL.cpp.

## withStatusCode()

URL::InputStreamOptions juce::URL::InputStreamOptions::withStatusCode | ( | int * | statusCode | ) | const

nodiscard

If this is non-null, it will get set to the http status code, if one is known, or 0 if a code isn't available.

Definition at line 719 of file juce_URL.cpp.

The documentation for this class was generated from the following files:

- juce_URL.h
- juce_URL.cpp