NSURL(SFStringUtils) Category Reference

Declared in NSURL+SFStringUtils.h

Overview

Utilities for interacting with NSURL objects.

– sfsdk_redactedAbsoluteString:

Will return the absolute string of a URL, with potentially sensitive querystring parameter values redacted. Useful for logging URL values without sensitive data included.

- (NSString *)sfsdk_redactedAbsoluteString:(NSArray *)queryStringParamsToRedact

Parameters

queryStringParamsToRedact

An array of querystring parameter names whose values should be redacted.

Return Value

The redacted version of the absolute string value.

Declared In

NSURL+SFStringUtils.h

– redactedAbsoluteString:

- (NSString *)redactedAbsoluteString:(NSArray *)queryStringParamsToRedact

+ stringUrlWithBaseUrl:pathComponents:

Helper method that constructs an absolute URL string given the specified components.

+ (NSString *)stringUrlWithBaseUrl:(NSURL *)baseUrl pathComponents:(NSArray *)pathComponents

Parameters

baseUrl

The base URL

pathComponents

The components of the path

Return Value

an absolute string URL representation

Declared In

NSURL+SFStringUtils.h

+ stringUrlWithScheme:host:port:pathComponents:

Helper method that constructs an absolute URL string given the specified components.

+ (NSString *)stringUrlWithScheme:(NSString *)scheme host:(NSString *)host port:(NSNumber *)port pathComponents:(NSArray *)pathComponents

Parameters

scheme

The scheme of the URL

host

The host of the URL

port

The port of the URL

pathComponents

The components of the path

Return Value

an absolute string URL representation

Declared In

NSURL+SFStringUtils.h

– slashTerminatedUrl

Adds a trailing slash to the URL’s path, if necessary

- (NSURL *)slashTerminatedUrl

Return Value

A URL whose path ends in a forward slash

Declared In

NSURL+SFStringUtils.h