IHttpNegotiate::OnResponse method

Enables 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(
  [in]  DWORD   dwResponseCode,
  [in]  LPCWSTR szResponseHeaders,
  [in]  LPCWSTR szRequestHeaders,
  [out] LPWSTR  *pszAdditionalRequestHeaders
);

Parameters

  • dwResponseCode [in]
    An unsigned long integer value that contains the HTTP response code that is returned in response to a previous HTTP request. For information about these codes, see the HTTP specification.

  • szResponseHeaders [in]
    The address of a string value that contains the response headers from the HTTP server.

  • szRequestHeaders [in]
    The address of a string value that contains HTTP request headers that are used when the request is sent again, if dwResponseCode indicates an error.

  • pszAdditionalRequestHeaders [out]
    The 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

Returns one of the following values.

Return code 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, optionally, can abort the bind operation. If dwResponseCode indicates a failure, the client can add HTTP headers to the request before it is sent again.

Note 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 that provides this callback receives notifications. Each one is given a chance to add HTTP headers or to abort the HTTP transaction. In such cases, the last client to receive callback notification is the client that is driving the download operation, and it dictates the final decision.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Product

Internet Explorer 4.0

DLL

Urlmon.dll

See also

IHttpNegotiate