Table of Contents

Class HeaderFormatter

Namespace
NetCoreForce.Client
Assembly
NetCoreForce.Client.dll

Formats custom HTTP request and response headers used for REST API

See also Salesforce REST API Developer Guide - Headers

public static class HeaderFormatter
Inheritance
HeaderFormatter
Inherited Members

Methods

IfModifiedSince(DateTimeOffset)

Use the Describe Global resource and the If-Modified-Since HTTP header to determine if an object’s metadata has changed.

public static Dictionary<string, string> IfModifiedSince(DateTimeOffset startDate)

Parameters

startDate DateTimeOffset

Start date after which to look for changed object metadata

Returns

Dictionary<string, string>

Single entry dictionary of "If-Modified-Since" with date value in the RFC1123 Pattern

SforceAutoAssign(bool)

Assignment Rule Header

The Assignment Rule header is a request header applied when creating or updating Cases or Leads. If enabled, the active assignment rules are used. If disabled, the active assignment rules are not applied. If a valid AssignmentRule ID is provided, the AssignmentRule is applied. If the header is not provided with a request, REST API defaults to using the active assignment rules.

public static Dictionary<string, string> SforceAutoAssign(bool autoAssign)

Parameters

autoAssign bool

Active assignment rules are applied for created or updated Cases or Leads

Returns

Dictionary<string, string>

Single entry dictionary of "Sforce-Auto-Assign" with TRUE/FALSE value

SforceCallOptions(string, string)

Call Options Header

Specifies the client-specific options when accessing REST API resources. For example, you can write client code that ignores namespace prefixes by specifying the prefix in the call options header.

The Call Options header can be used with SObject Basic Information, SObject Rows, Query, QueryAll, Search, and SObject Rows by External ID.
public static Dictionary<string, string> SforceCallOptions(string client = "ForceClient", string defaultNamespace = null)

Parameters

client string

A string that identifies a client.

defaultNamespace string

A string that identifies a developer namespace prefix. Resolve field names in managed packages without having to specify the namespace everywhere.

Returns

Dictionary<string, string>

Single entry dictionary of "Sforce-Call-Options" with value of client={client}, defaultNamespace={defaultNamespace}

SforceQueryOptions(int)

Query Options Header

Specifies options used in a query, such as the query results batch size. Use this request header with the Query resource.

Child objects count toward the number of records for the batch size. For example, in relationship queries, multiple child objects are returned per parent row returned. The default is 2,000; the minimum is 200, and the maximum is 2,000. There is no guarantee that the requested batch size is the actual batch size. Changes are made as necessary to maximize performance.
public static Dictionary<string, string> SforceQueryOptions(int batchSize)

Parameters

batchSize int

the number of records returned for a query request

Returns

Dictionary<string, string>

Single entry dictionary of "Sforce-Query-Options" with value of batchSize={batchSize}