mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
2.8 KiB
Objective-C
47 lines
2.8 KiB
Objective-C
#import "HttpRequestUtil.h"
|
|
#import "Constraints.h"
|
|
#import "PreferencesUtil.h"
|
|
#import "Util.h"
|
|
|
|
@implementation HttpRequest (HttpRequestUtil)
|
|
|
|
+(HttpRequest*)httpRequestWithBasicAuthenticationAndMethod:(NSString*)method
|
|
andLocation:(NSString*)location {
|
|
return [HttpRequest httpRequestWithBasicAuthenticationAndMethod:method
|
|
andLocation:location
|
|
andOptionalBody:nil];
|
|
}
|
|
+(HttpRequest*)httpRequestWithBasicAuthenticationAndMethod:(NSString*)method
|
|
andLocation:(NSString*)location
|
|
andOptionalBody:(NSString*)optionalBody {
|
|
return [HttpRequest httpRequestWithBasicAuthenticationAndMethod:method
|
|
andLocation:location
|
|
andOptionalBody:optionalBody
|
|
andLocalNumber:[[[Environment getCurrent] preferences] forceGetLocalNumber]
|
|
andPassword:[[[Environment getCurrent] preferences] getOrGenerateSavedPassword]];
|
|
}
|
|
+(HttpRequest*)httpRequestWithOtpAuthenticationAndMethod:(NSString*)method
|
|
andLocation:(NSString*)location {
|
|
return [HttpRequest httpRequestWithOtpAuthenticationAndMethod:method
|
|
andLocation:location
|
|
andOptionalBody:nil];
|
|
}
|
|
+(HttpRequest*)httpRequestWithOtpAuthenticationAndMethod:(NSString*)method
|
|
andLocation:(NSString*)location
|
|
andOptionalBody:(NSString*)optionalBody {
|
|
return [HttpRequest httpRequestWithOtpAuthenticationAndMethod:method
|
|
andLocation:location
|
|
andOptionalBody:optionalBody
|
|
andLocalNumber:[[[Environment getCurrent] preferences] forceGetLocalNumber]
|
|
andPassword:[[[Environment getCurrent] preferences] getOrGenerateSavedPassword]
|
|
andCounter:[[[Environment getCurrent] preferences] getAndIncrementOneTimeCounter]];
|
|
}
|
|
+(HttpRequest*)httpRequestUnauthenticatedWithMethod:(NSString*)method
|
|
andLocation:(NSString*)location {
|
|
return [HttpRequest httpRequestUnauthenticatedWithMethod:method
|
|
andLocation:location
|
|
andOptionalBody:nil];
|
|
}
|
|
|
|
@end
|