MBXHttpRequest


@interface MBXHttpRequest : NSObject

HttpRequest holds basic information for construction of an HTTP request

  • HTTP defines a set of request methods to indicate the desired action to be performed for a given resource. Specify desired method using this parameter.

    Declaration

    Objective-C

    @property (nonatomic) MBXHttpMethod method;
  • url

    URL the request should be sent to

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nonnull) NSString *url;
  • HTTP headers to include. If you provide User-Agent header using this headers field, then resulting User-Agent will also contain information about application, platform, device, and Common SDK’s version. If you provide duplicate headers then request call will be immediately failed.

    Declaration

    Objective-C

    @property (nonatomic, copy, nonnull) NSDictionary<NSString *, NSString *> *headers;
  • Keep compression flag. If set to true, responses will not be automatically decompressed. Default is false.

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=isKeepCompression) BOOL keepCompression;
  • Timeout defines how long, in seconds, the request is allowed to take in total (including connecting to the host). Default is 0, meaning no timeout.

    Declaration

    Objective-C

    @property (nonatomic, readonly) uint64_t timeout;
  • Restrict the request to the specified network types. If none of the specified network types is available, the download fails with a connection error.

    Default is allowed to all network types

    Declaration

    Objective-C

    @property (nonatomic, readonly) MBXNetworkRestriction networkRestriction;
  • Application and SDK information for generating a User-Agent string. Attention! Setting this field has no effect, please use headers field instead. This field will be removed in the next major versions.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nonnull) MBXUAComponents *uaComponents;
  • HTTP Body data transmitted in an HTTP transaction message immediately following the headers if there is any. Body data is used by POST HTTP methods.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSData *body;