Partager via


IHttpNegotiate::OnResponse

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This method allows for the client of a bind operation to examine the response headers, optionally terminate the bind operation, and add HTTP headers to a request before resending the request.

Syntax

HRESULT OnResponse(
  DWORD dwResponseCode,
  LPCWSTR szResponseHeaders,
  LPCWSTR szRequestHeaders,
  LPWSTR* pszAdditionalRequestHeaders
);

Parameters

  • dwResponseCode
    [in] Unsigned long integer value that contains the HTTP response code returned in response to a previous HTTP request. For information about these codes, see the HTTP specification.
  • szResponseHeaders
    [in] Address of a string value that contains the response headers from the HTTP server.
  • szRequestHeaders
    [in] Address of a string value that contains HTTP request headers that will be used when the request is sent again, if dwResponseCode indicates an error.
  • pszAdditionalRequestHeaders
    [out] Address of a string value that contains additional headers to add before the request is sent again, if dwResponseCode indicates an error. If the specified header value conflicts with existing values in szRequestHeaders, the new headers take precedence. If pszAdditionalRequestHeaders is set to NULL, no headers are added to the HTTP request.

Return Value

This method returns one of the values that are shown in the following table.

Value Description

S_OK

The operation completed successfully. If dwResponseCode indicates an error, any pszAdditionalRequestHeaders are appended and the request is sent again.

E_ABORT

Terminate the HTTP transaction.

E_INVALIDARG

The parameter is invalid.

Remarks

The URL moniker calls this method when it receives a response to an HTTP request. If dwResponseCode indicates a success, the client can examine the response headers and can abort the bind operation. If dwResponseCode indicates a failure, the client can add HTTP headers to the request before it is sent again.

Be aware that if multiple clients have registered on the bind context for a given bind operation, more than one of these clients can provide an IHttpNegotiate callback interface. Every client providing this callback receives notifications. Each one is given an opportunity to add HTTP headers or to abort the HTTP transaction. In these cases, the last client to receive callback notification is the client driving the download operation, and it will dictate the final decision.

Requirements

Header urlmon.h, urlmon.idl
Library urlmon.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

URL Moniker Services Interfaces