GTMNSDictionary+URLArguments.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // GTMNSDictionary+URLArguments.h
  3. //
  4. // Copyright 2006-2008 Google Inc.
  5. //
  6. // Licensed under the Apache License, Version 2.0 (the "License"); you may not
  7. // use this file except in compliance with the License. You may obtain a copy
  8. // of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  14. // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  15. // License for the specific language governing permissions and limitations under
  16. // the License.
  17. //
  18. #import <Foundation/Foundation.h>
  19. /// Utility for building a URL or POST argument string.
  20. @interface NSDictionary (GTMNSDictionaryURLArgumentsAdditions)
  21. /// Returns a dictionary of the decoded key-value pairs in a http arguments
  22. /// string of the form key1=value1&key2=value2&...&keyN=valueN.
  23. /// Keys and values will be unescaped automatically.
  24. /// Only the first value for a repeated key is returned.
  25. ///
  26. /// NOTE: Apps targeting iOS 8 or OS X 10.10 and later should use
  27. /// NSURLComponents and NSURLQueryItem to create URLs with
  28. /// query arguments instead of using these category methods.
  29. + (NSDictionary *)gtm_dictionaryWithHttpArgumentsString:(NSString *)argString NS_DEPRECATED(10_0, 10_10, 2_0, 8_0, "Use NSURLComponents and NSURLQueryItem.");
  30. /// Gets a string representation of the dictionary in the form
  31. /// key1=value1&key2=value2&...&keyN=valueN, suitable for use as either
  32. /// URL arguments (after a '?') or POST body. Keys and values will be escaped
  33. /// automatically, so should be unescaped in the dictionary.
  34. - (NSString *)gtm_httpArgumentsString NS_DEPRECATED(10_0, 10_10, 2_0, 8_0, "Use NSURLComponents and NSURLQueryItem.");
  35. @end