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

# Web request differences between GDK and XDK

> Differences between web requests in the Microsoft Game Development Kit and the XBOX One Software Development Kit

This article describes the differences for web request APIs between the Microsoft Game Development Kit (GDK) and the XBOX One Software Development Kit. `WinHttp` is the new Win32 HTTP API that replaces the `IXMLHttpRequest2` (IXHR2) and `IMessageWebSocket` APIs. `WinHttp` is a lower-level API than IXHR2 is and thus lacks some features as compared to IXHR2, such as content caching, cookies, automatic XBOX services token insertion, and automatic security enforcement. In return, `WinHttp` is much more performant by being in-process, having less overhead, and avoiding excessive memory copies. In addition, `WinHttp` supports HTTP/1.1, HTTP/2, and WebSockets, all in one API, and includes features that are missing from IXHR2, such as chunked uploads.

`XCurl` is an HTTP API for the Microsoft Game Development Kit (GDK). `XCurl` provides a simpler API through an adapter over `WinHttp`. The `XCurl` API surface broadly matches [libCurl](https://curl.haxx.se/libcurl/). `XCurl` simplifies title development by handling security best practices automatically and by handling network initialization.

In addition to `WinHttp`, the XBOX Services API (`XSAPI`) provides the simple [http\_call](/reference/live/xsapi-c/http_call_c/http_call_c_members) set of APIs that you can use to make REST HTTP requests to your own custom servers. We recommend using `XSAPI` for any REST requests that your title makes to your own services and to  XBOX services.
For more information about `XSAPI`, see [Getting started with XBOX Services APIs](/services/xbox-services/fundamentals/xbox-services-api/live-gs-xbl-apis).

The GDK includes a [SimpleWinHttp sample](https://aka.ms/gdkdl) that abstracts WinHTTP usage into a simple Microsoft Game Development Kit (GDK) asynchronous model. We recommend that you use this sample as a starting point for your own WinHTTP implementation because it covers many of the details involved in building a secure and robust WinHTTP integration.

For more information about how to use `XCurl` or `WinHttp`, see [HTTP and web sockets](/build/console-features/networking/web-requests/http-networking).

## Network initialization

Your title is started as soon as possible during the Game OS startup process. You can start loading assets from the hard drive and begin initializing the graphics stack. However, your code is executing before the network services are started, which leads to a period of time where it's not safe to use the Win32 network APIs. We define this time period as the *network initialization* period, after which the network is considered initialized. Network initialization typically takes a few seconds, which can be noticeable in your code.

Network initialization for XBOX One ERA titles would implicitly and arbitrarily stall otherwise real-time-safe network APIs, such as `WSAStartup` or `bind`. With Microsoft Game Development Kit (GDK) apps, network initialization is now an explicit concept that you must interact with to use any Win32 networking or security APIs.

Microsoft Game Development Kit (GDK) titles must wait until the `XNetworkingConnectivityHint::networkInitialized` Boolean is set to `true` before calling into any networking API in `Winsock`, `WinHttp`, `IP Helper`, `BCrypt`, `WinCrypt`, `Schannel`, or any other networking Win32 API. Calling into any of these APIs before the network is initialized results in indeterminate behavior up to and including random process crashes.

Furthermore, this same concept applies on all suspend/resume cycles. On suspend, Microsoft Game Development Kit (GDK) titles should close all network and security handles. Microsoft Game Development Kit (GDK) titles should then treat the resume handler the same as the initial title launch from a networking perspective and again wait for the network to become initialized.

For more information, including code examples showing how to wait for network initialization, see [Network initialization and connectivity](/build/console-features/networking/initialization-connectivity-networking).

## See also

[Network initialization and connectivity](/build/console-features/networking/initialization-connectivity-networking)

[Communication Security Overview](/build/game-principles/security/communication-security-overview)

[Getting Started with XBOX Services APIs](/services/xbox-services/fundamentals/xbox-services-api/live-gs-xbl-apis)

[http\_call\_c](/reference/live/xsapi-c/http_call_c/http_call_c_members)


## Related topics

- [Migrating XDK networking to the XBOX GDK](/build/console-features/networking/xdk-migration/index.md)
- [XBOX One Software Development Kit migration guides](/build/console-features/networking/xdk-migration/xdk-migration-toc.md)
- [Web requests](/build/console-features/networking/web-requests/web-requests-toc.md)
- [Game mesh communication: GDK vs XDK differences](/build/console-features/networking/xdk-migration/xdk-migration-game-mesh-networking.md)
- [Conceptual differences between the GDK and Steamworks](/build/steam-porting-guide/conceptual-differences.md)
