Browse Source

Added method URL::withParameters

tags/2021-05-28
jules 11 years ago
parent
commit
aecbf88998
2 changed files with 17 additions and 0 deletions
  1. +11
    -0
      modules/juce_core/network/juce_URL.cpp
  2. +6
    -0
      modules/juce_core/network/juce_URL.h

+ 11
- 0
modules/juce_core/network/juce_URL.cpp View File

@@ -397,6 +397,17 @@ URL URL::withParameter (const String& parameterName,
return u;
}
URL URL::withParameters (const StringPairArray& parametersToAdd) const
{
URL u (*this);
for (int i = 0; i < parametersToAdd.size(); ++i)
u.addParameter (parametersToAdd.getAllKeys()[i],
parametersToAdd.getAllValues()[i]);
return u;
}
URL URL::withPOSTData (const String& newPostData) const
{
URL u (*this);


+ 6
- 0
modules/juce_core/network/juce_URL.h View File

@@ -140,6 +140,12 @@ public:
URL withParameter (const String& parameterName,
const String& parameterValue) const;
/** Returns a copy of this URL, with a set of GET or POST parameters added.
This is a convenience method, equivalent to calling withParameter for each value.
@see withParameter
*/
URL withParameters (const StringPairArray& parametersToAdd) const;
/** Returns a copy of this URL, with a file-upload type parameter added to it.
When performing a POST where one of your parameters is a binary file, this


Loading…
Cancel
Save