ADEumHTTPRequestTracker Class Reference

Inherits from NSObject
Declared in ADEumHTTPRequestTracker.h

Overview

If the SDK does not automatically discover your HTTP requests, use this class to explicitly report them. Note that most users will not need to use this class; check the documentation for the list of HTTP APIs that are automatically discovered.

+ requestTrackerWithURL:

Begins tracking an HTTP request.

+ (ADEumHTTPRequestTracker *)requestTrackerWithURL:(NSURL *)url

Parameters

url

The URL being requested.

Discussion

Call this immediately before sending an HTTP request to track it manually.

Warning: url must not be nil.

Warning: One of ADEumInstrumentation’s initWithKey: methods must be called before this method.

Declared In

ADEumHTTPRequestTracker.h

– reportDone

Stops tracking an HTTP request.

- (void)reportDone

Discussion

Immediately after receiving a response or an error, set the appropriate properties and call this method to report the outcome of the HTTP request. You should not continue to use this object after calling this method – if you need to track another request, call requestTrackerWithURL:.

Declared In

ADEumHTTPRequestTracker.h

– setUserData:value:

Sets the value of the specified key to the specified string value.

- (void)setUserData:(NSString *ADEUM_NULLABLE)key value:(NSString *)value

Parameters

key

The key with which to associate with the value.

value

The non-nil NSString value to store.

Discussion

Notes

  • All UserData interfaces are type specific and maintain a separate key name space. This means that both +setUserDataBoolean:value: and +setUserDataLong:value: can use a key of @"foo".

  • UserData can be used to relay any information available to the programmer.

  • Unlike the global UserData methods, data attached to an HTTPRequestTracker are only reported for this particular network call.

Warning: Both the key and the value will if be truncated if they are longer than 2048 characters.

Declared In

ADEumHTTPRequestTracker.h

– setUserDataLong:value:

Sets the value of the specified key to the specified signed 64-bit integer value.

- (void)setUserDataLong:(NSString *ADEUM_NULLABLE)key value:(int64_t)value

Parameters

key

The key with which to associate with the value.

value

Signed 64-bit integer value to store.

Declared In

ADEumHTTPRequestTracker.h

– setUserDataBoolean:value:

Sets the value of the specified key to the specified Boolean value.

- (void)setUserDataBoolean:(NSString *ADEUM_NULLABLE)key value:(BOOL)value

Parameters

key

The key with which to associate with the value.

value

The boolean value to store.

Declared In

ADEumHTTPRequestTracker.h

– setUserDataDouble:value:

Sets the value of the specified key to the specified double value.

- (void)setUserDataDouble:(NSString *ADEUM_NULLABLE)key value:(double)value

Parameters

key

The key with which to associate with the value.

value

The double value to store. The value has to be a finite real number. The use of NAN, +INF or -INF may lead to undefined behavior.

Declared In

ADEumHTTPRequestTracker.h

– setUserDataDate:value:

Sets the value of the specified key to the specified NSDate object.

- (void)setUserDataDate:(NSString *ADEUM_NULLABLE)key value:(NSDate *)value

Parameters

key

The key with which to associate with the value.

value

The non-nil NSDate object to store.

Discussion

Note

The Date value will be stored as a signed 64-bit integer representing milliseconds since 1970 (epoch time) UTC.

Declared In

ADEumHTTPRequestTracker.h

  url

The URL for the network request

@property (copy, nonatomic) NSURL *url

Declared In

ADEumHTTPRequestTracker.h

  error

An error describing the failure to receive a response, if one occurred.

@property (copy, nonatomic) NSError *error

Discussion

If the request was successful, this should be nil.

Declared In

ADEumHTTPRequestTracker.h

  statusCode

The status code of response, if one was received.

@property (copy, nonatomic) NSNumber *statusCode

Discussion

If a response was received, this should be an an integer. If an error occurred and a response was not received, this should be nil.

Declared In

ADEumHTTPRequestTracker.h

  allHeaderFields

A dictionary representing the keys and values from the server’s response header.

@property (copy, nonatomic) NSDictionary *allHeaderFields

Discussion

If an error occurred and a response was not received, this should be nil.

Declared In

ADEumHTTPRequestTracker.h

  allRequestHeaderFields

A dictionary representing the keys and values from the client’s request header.

@property (copy, nonatomic) NSDictionary *allRequestHeaderFields

Declared In

ADEumHTTPRequestTracker.h

  instrumentationSource

A string to identify the source of the instrumentation that generated this tracker.

@property (copy, nonatomic) NSString *instrumentationSource

Discussion

The default is “Manual HttpTracker”.

You should not have to modify this.

Declared In

ADEumHTTPRequestTracker.h