EMBNetworkRequest
@interface EMBNetworkRequest : NSObject
This class is used to create manually-recorded network requests.
-
The request’s URL. Must start with http:// or https://
Declaration
Objective-C
@property (nonatomic, strong, readonly, nonnull) NSURL *url;
Swift
var url: URL { get }
-
The request’s method. Must be one of the following: GET, PUT, POST, DELETE, PATCH.
Declaration
Objective-C
@property (nonatomic, strong, readonly, nonnull) NSString *method;
Swift
var method: String { get }
-
The time the request started.
Declaration
Objective-C
@property (nonatomic, strong, readonly, nonnull) NSDate *startTime;
Swift
var startTime: Date { get }
-
The time the request ended. Must be greater than the startTime.
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSDate *endTime;
Swift
var endTime: Date? { get set }
-
The number of bytes received.
Declaration
Objective-C
@property (nonatomic) NSInteger bytesIn;
Swift
var bytesIn: Int { get set }
-
The number of bytes received.
Declaration
Objective-C
@property (nonatomic) NSInteger bytesOut;
Swift
var bytesOut: Int { get set }
-
The response status of the request. Must be in the range 100 to 599.
Declaration
Objective-C
@property (nonatomic) NSInteger responseCode;
Swift
var responseCode: Int { get set }
-
NSError that describes a non-HTTP error, e.g. a connection error.
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSError *error;
Swift
var error: Error? { get set }
-
Optional trace ID that can be used to trace a particular request. Max length is 64 characters.
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSString *traceId;
Swift
var traceId: String? { get set }
-
The time the request started specified in seconds.
Declaration
Objective-C
@property (nonatomic, readonly) NSTimeInterval startEpoch;
Swift
var startEpoch: TimeInterval { get }
-
The time the request ended specified in seconds.
Declaration
Objective-C
@property (nonatomic, readonly) NSTimeInterval endEpoch;
Swift
var endEpoch: TimeInterval { get }
-
Deprecated
Please replace calls to initialize network requests with methods of the form networkRequestWithURLString:method:startTime:
Creates an EMBNetwork Request with the URL, method, and start time set
Declaration
Objective-C
+ (nullable instancetype)initWithURLString:(nonnull NSString *)urlString method:(nonnull NSString *)method startTime:(nonnull NSDate *)startTime;
Swift
class func initWithURLString(_ urlString: String, method: String, startTime: Date) -> Self?
Parameters
urlString
The request’s URL. Must start with http:// or https://
method
The request’s method. Must be one of the following: GET, PUT, POST, DELETE, PATCH.
startTime
The time the request started.
Return Value
An EMBNetworkRequest object
-
Creates an EMBNetwork Request with the URL, method, and start time set
Declaration
Objective-C
+ (nullable instancetype) networkRequestWithURLString:(nonnull NSString *)urlString method:(nonnull NSString *)method startTime:(nonnull NSDate *)startTime;
Swift
convenience init?(urlString: String, method: String, startTime: Date)
Parameters
urlString
The request’s URL. Must start with http:// or https://
method
The request’s method. Must be one of the following: GET, PUT, POST, DELETE, PATCH.
startTime
The time the request started.
Return Value
An EMBNetworkRequest object
-
Deprecated
Please replace calls to initialize network requests with methods of the form networkRequestWithURLString:method:startTime:endTime:bytesIn:bytesOut:responseCode:error:traceId:
Creates an EMBNetwork Request with the URL, method, start time, end time, bytes sent, bytes received, response code, error, and traceId set.
Declaration
Objective-C
+ (nullable instancetype)initWithURLString:(nonnull NSString *)urlString method:(nonnull NSString *)method startTime:(nonnull NSDate *)startTime endTime:(nullable NSDate *)endTime bytesIn:(NSInteger)bytesIn bytesOut:(NSInteger)bytesOut responseCode:(NSInteger)responseCode error:(nullable NSError *)error traceId:(nullable NSString *)traceId;
Swift
class func initWithURLString(_ urlString: String, method: String, startTime: Date, endTime: Date?, bytesIn: Int, bytesOut: Int, responseCode: Int, error: Error?, traceId: String?) -> Self?
Parameters
urlString
The request’s URL. Must start with http:// or https://
method
The request’s method. Must be one of the following: GET, PUT, POST, DELETE, PATCH.
startTime
The time the request started.
endTime
The time the request ended. Must be greater than the startTime.
bytesIn
The number of bytes received.
bytesOut
The number of bytes received.
responseCode
The response status of the request. Must be in the range 100 to 599.
error
NSError that describes a non-HTTP error, e.g. a connection error.
traceId
Optional trace ID that can be used to trace a particular request. Max length is 64 characters.
Return Value
An EMBNetworkRequest object
-
Creates an EMBNetwork Request with the URL, method, start time, end time, bytes sent, bytes received, response code, error, and traceId set.
Declaration
Objective-C
+ (nullable instancetype) networkRequestWithURLString:(nonnull NSString *)urlString method:(nonnull NSString *)method startTime:(nonnull NSDate *)startTime endTime:(nullable NSDate *)endTime bytesIn:(NSInteger)bytesIn bytesOut:(NSInteger)bytesOut responseCode:(NSInteger)responseCode error:(nullable NSError *)error traceId:(nullable NSString *)traceId;
Swift
convenience init?(urlString: String, method: String, startTime: Date, endTime: Date?, bytesIn: Int, bytesOut: Int, responseCode: Int, error: Error?, traceId: String?)
Parameters
urlString
The request’s URL. Must start with http:// or https://
method
The request’s method. Must be one of the following: GET, PUT, POST, DELETE, PATCH.
startTime
The time the request started.
endTime
The time the request ended. Must be greater than the startTime.
bytesIn
The number of bytes received.
bytesOut
The number of bytes received.
responseCode
The response status of the request. Must be in the range 100 to 599.
error
NSError that describes a non-HTTP error, e.g. a connection error.
traceId
Optional trace ID that can be used to trace a particular request. Max length is 64 characters.
Return Value
An EMBNetworkRequest object
-
Deprecated
Please replace calls to initialize network requests with methods of the form networkRequestWithURL:method:startTime:
Creates an EMBNetwork Request with the URL, method, and start time set
Declaration
Objective-C
+ (nullable instancetype)initWithURL:(nonnull NSURL *)url method:(nonnull NSString *)method startTime:(nonnull NSDate *)startTime;
Swift
class func initWith(_ url: URL, method: String, startTime: Date) -> Self?
Parameters
url
The request’s NSURL. Must start with http:// or https://
method
The request’s method. Must be one of the following: GET, PUT, POST, DELETE, PATCH.
startTime
The time the request started.
Return Value
An EMBNetworkRequest object
-
Creates an EMBNetwork Request with the URL, method, and start time set
Declaration
Objective-C
+ (nullable instancetype)networkRequestWithURL:(nonnull NSURL *)url method:(nonnull NSString *)method startTime:(nonnull NSDate *)startTime;
Swift
convenience init?(url: URL, method: String, startTime: Date)
Parameters
url
The request’s NSURL. Must start with http:// or https://
method
The request’s method. Must be one of the following: GET, PUT, POST, DELETE, PATCH.
startTime
The time the request started.
Return Value
An EMBNetworkRequest object
-
Deprecated
Please replace calls to initialize network requests with methods of the form networkRequestWithURL:method:startTime:endTime:bytesIn:bytesOut:responseCode:error:traceId:
Creates an EMBNetwork Request with the URL, method, start time, end time, bytes sent, bytes received, response code, error, and traceId set.
Declaration
Objective-C
+ (nullable instancetype)initWithURL:(nonnull NSURL *)url method:(nonnull NSString *)method startTime:(nonnull NSDate *)startTime endTime:(nullable NSDate *)endTime bytesIn:(NSInteger)bytesIn bytesOut:(NSInteger)bytesOut responseCode:(NSInteger)responseCode error:(nullable NSError *)error traceId:(nullable NSString *)traceId;
Swift
class func initWith(_ url: URL, method: String, startTime: Date, endTime: Date?, bytesIn: Int, bytesOut: Int, responseCode: Int, error: Error?, traceId: String?) -> Self?
Parameters
url
The request’s NSURL. Must start with http:// or https://
method
The request’s method. Must be one of the following: GET, PUT, POST, DELETE, PATCH.
startTime
The time the request started.
endTime
The time the request ended. Must be greater than the startTime.
bytesIn
The number of bytes received.
bytesOut
The number of bytes received.
responseCode
The response status of the request. Must be in the range 100 to 599.
error
NSError that describes a non-HTTP error, e.g. a connection error.
traceId
Optional trace ID that can be used to trace a particular request. Max length is 64 characters.
Return Value
An EMBNetworkRequest object
-
Creates an EMBNetwork Request with the URL, method, start time, end time, bytes sent, bytes received, response code, error, and traceId set.
Declaration
Objective-C
+ (nullable instancetype)networkRequestWithURL:(nonnull NSURL *)url method:(nonnull NSString *)method startTime:(nonnull NSDate *)startTime endTime:(nullable NSDate *)endTime bytesIn:(NSInteger)bytesIn bytesOut:(NSInteger)bytesOut responseCode:(NSInteger)responseCode error:(nullable NSError *)error traceId:(nullable NSString *)traceId;
Swift
convenience init?(url: URL, method: String, startTime: Date, endTime: Date?, bytesIn: Int, bytesOut: Int, responseCode: Int, error: Error?, traceId: String?)
Parameters
url
The request’s NSURL. Must start with http:// or https://
method
The request’s method. Must be one of the following: GET, PUT, POST, DELETE, PATCH.
startTime
The time the request started.
endTime
The time the request ended. Must be greater than the startTime.
bytesIn
The number of bytes received.
bytesOut
The number of bytes received.
responseCode
The response status of the request. Must be in the range 100 to 599.
error
NSError that describes a non-HTTP error, e.g. a connection error.
traceId
Optional trace ID that can be used to trace a particular request. Max length is 64 characters.
Return Value
An EMBNetworkRequest object