> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XblCallRoutedHandler

> Defines a callback that receives notifications about HTTP service call attempts.

# XblCallRoutedHandler

A callback that receives notifications about HTTP service call attempts.

## Syntax

```cpp theme={null}
typedef void (STDAPIVCALLTYPE* XblCallRoutedHandler)(  
         _In_ XblServiceCallRoutedArgs args,  
         _In_opt_ void* context  
);  
```

### Parameters

*args*   \_In\_\
Type: [XblServiceCallRoutedArgs](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/structs/xblservicecallroutedargs.md)

Contains information about the HTTP call attempt. The fields are valid only until the callback returns.

*context*   \_In\_opt\_\
Type: void\*

The caller context that was passed to [XblAddServiceCallRoutedHandler](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/functions/xbladdservicecallroutedhandler.md) when the handler was registered.

### Return value

Type: void

## Remarks

Register the callback by calling [XblAddServiceCallRoutedHandler](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/functions/xbladdservicecallroutedhandler.md), and unregister it by passing the returned token to [XblRemoveServiceCallRoutedHandler](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/functions/xblremoveservicecallroutedhandler.md). You can use the callback to track intermittent failures, similar to a web debugging proxy such as Fiddler.

The callback runs synchronously during libHttpClient request-attempt completion processing. It's invoked for successful attempts and for attempts that are retried. The callback is registered with libHttpClient, so it isn't limited to calls that the XBOX Services API (XSAPI) makes.

The fields of *args* are valid only until the callback returns. Copy any string contents that you need before you return. To keep using `args.call` after the callback returns, duplicate the handle by calling [HCHttpCallDuplicateHandle](https://docs.xbox.com/reference/live/httpclient/httpclient/functions/hchttpcallduplicatehandle.md), and close the duplicate later by calling [HCHttpCallCloseHandle](https://docs.xbox.com/reference/live/httpclient/httpclient/functions/hchttpcallclosehandle.md).

The `fullResponseFormatted` string can include response headers and the response body. Don't assume that the complete string is sanitized before you log or store it.

## Argument of

[XblAddServiceCallRoutedHandler](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/functions/xbladdservicecallroutedhandler.md)

## Requirements

**Header:** xbox\_live\_global\_c.h

**Library:** Microsoft.Xbox.Services.142.C.lib or Microsoft.Xbox.Services.143.C.lib

## See also

[xbox\_live\_global\_c](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/xbox_live_global_c_members.md)\
[XblServiceCallRoutedArgs](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/structs/xblservicecallroutedargs.md)


## Related topics

- [XblAddServiceCallRoutedHandler](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/functions/xbladdservicecallroutedhandler.md)
- [XblServiceCallRoutedArgs](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/structs/xblservicecallroutedargs.md)
- [xbox_live_global_c (contents)](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/xbox_live_global_c_members.md)
- [XblRemoveServiceCallRoutedHandler](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/functions/xblremoveservicecallroutedhandler.md)
- [HCCallRoutedHandler](https://docs.xbox.com/reference/live/httpclient/httpclient/functions/hccallroutedhandler.md)
