Exportar (0) Imprimir
Expandir Tudo

TPM OM API: Request and Response Headers

Atualizado: novembro de 2013

TPM OM API enables users to send OData-based HTTP requests to create TPM OM entities and receive responses in verbose JSON, atom+pub, or straight XML. Because the TPM OM API conforms to Azure design guidelines, there is a set of required HTTP headers that each client must use when connecting to the TPM OM API REST endpoint, as well as a set of optional headers that can be used. The following sections describe the headers and HTTP verbs you can use with the TPM OM API.

Supported HTTP Request Headers

Every call made to the TPM OM API REST endpoints must include a set of required headers and also a set of optional headers, if you want to. The following table lists the required headers:

Required Headers

 

Header Type Value

Authorization

WRAP ACS tokens

The value must include the access token provided by the Controle de Acesso do Active Directory do Microsoft Azure (também conhecido como Serviço de Controle de Acesso ou ACS). For instructions on how to retrieve an ACS token using the WRAP protocol, see http://msdn.microsoft.com/library/windowsazure/hh674475.aspx.

Host

String

Specifies the host and the port number of the resource being targeted.

DataServiceVersion

Decimal

1.0

MaxDataServiceVersion

Decimal

3.0

x-ms-version

Decimal

1.0

If-Match

Entity tag

Specifies that an operation is performed only if the entity tag specified in the request header matches with the entity tag of the object.

noteObservação
This header is required only when performing update or delete operations.

noteObservação
Because the TPM OM API uses OData to expose its underlying asset metadata repository through REST APIs, the DataServiceVersion and MaxDataServiceVersion headers should be included in any request; however, if they are not, then currently the TPM OM API assumes the DataServiceVersion value in use is 1.0.

Optional Headers

 

Header Type Value

Date

RFC 1123 date

Timestamp of the request

Accept

Content type

The requested content type for the response such as the following:

  • application/xml

  • application/json;odata=verbose

  • application/atom+xml

Accept-Encoding

Gzip, deflate

GZIP and DEFLATE encoding, when applicable.

Accept-Language

"en", "es", and so on

Specifies the preferred language of the response.

Accept-Charset

Charset type like UTF-8

Default is UTF-8

X-HTTP-Method

HTTP Method

Allows clients or firewalls that do not support HTTP methods like PUT or DELETE to use these methods, tunneled via a GET call.

Content-Type

Content type

Content type of the request body in POST and PUT requests.

Supported HTTP Response Headers

The following is a set of headers that may be returned to you depending on the resource you were requesting and the action you intended to perform.

 

Header Type Value

Date

RFC 1123 date

The date that the request was processed

Content-Type

Varies

The content type of the response body

Content-Encoding

Varies

Gzip or deflate, as appropriate

Cache-Control

-

Specifies whether caching mechanisms, from server to client, may cache the object.

Content-Length

Content type

The length of the response body

Server

-

A server name.

X-Content-Type-Options

Content type

The only possible value “nonsniff” prevents browsers from MIME-sniffing a response from the declared content-type.

Supported HTTP Verbs

The following is a complete list of HTTP verbs that are supported by the TPM OM API and can be used when making HTTP requests:

 

VERB Description

GET

Returns the current value for an entity

POST

Creates an object (or submits a command) based on the provided data

PUT

Replaces an object, or creates a new object (when applicable)

DELETE

Deletes an object

MERGE

Updates an existing object with named property changes.

Contribuições da comunidade

ADICIONAR
A Microsoft está realizando uma pesquisa online para saber sua opinião sobre o site do MSDN. Se você optar por participar, a pesquisa online lhe será apresentada quando você sair do site do MSDN.

Deseja participar?
Mostrar:
© 2014 Microsoft