You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"payload":{"allShortcutsEnabled":false,"path":"Chapter13","repo":{"id":944440034,"defaultBranch":"master","name":"Java-Coding-Problems","ownerLogin":"hqtrung01Yuk","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2025-03-07T10:51:50.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/142192878?v=4","public":true,"private":false,"isOrgOwned":false},"currentUser":null,"refInfo":{"name":"master","listCacheKey":"v0:1741344714.4336362","canEdit":false,"refType":"branch","currentOid":"dffaf0da5b17d2390a40482a6378f1eb9bc2318c"},"tree":{"items":[{"name":"P250_QueryParametersBuilder","path":"Chapter13/P250_QueryParametersBuilder","contentType":"directory"},{"name":"P251_SimpleGETSync","path":"Chapter13/P251_SimpleGETSync","contentType":"directory"},{"name":"P252_SettingProxy","path":"Chapter13/P252_SettingProxy","contentType":"directory"},{"name":"P253_SettingGettingHeaders","path":"Chapter13/P253_SettingGettingHeaders","contentType":"directory"},{"name":"P254_SpecifyingHTTPMethod","path":"Chapter13/P254_SpecifyingHTTPMethod","contentType":"directory"},{"name":"P255_SettingRequestBody","path":"Chapter13/P255_SettingRequestBody","contentType":"directory"},{"name":"P256_ConnectionAuthentication","path":"Chapter13/P256_ConnectionAuthentication","contentType":"directory"},{"name":"P257_SettingTimeout","path":"Chapter13/P257_SettingTimeout","contentType":"directory"},{"name":"P258_SettingRedirectPolicy","path":"Chapter13/P258_SettingRedirectPolicy","contentType":"directory"},{"name":"P259_SyncAsync","path":"Chapter13/P259_SyncAsync","contentType":"directory"},{"name":"P260_HandlingCookies","path":"Chapter13/P260_HandlingCookies","contentType":"directory"},{"name":"P261_ResponseInformation","path":"Chapter13/P261_ResponseInformation","contentType":"directory"},{"name":"P262_ResponseBodyTypes","path":"Chapter13/P262_ResponseBodyTypes","contentType":"directory"},{"name":"P263_JsonViaHttpClient","path":"Chapter13/P263_JsonViaHttpClient","contentType":"directory"},{"name":"P264_Compression","path":"Chapter13/P264_Compression","contentType":"directory"},{"name":"P265_FormData","path":"Chapter13/P265_FormData","contentType":"directory"},{"name":"P266_DownloadOfFile","path":"Chapter13/P266_DownloadOfFile","contentType":"directory"},{"name":"P266_DownloadOfFileDownload","path":"Chapter13/P266_DownloadOfFileDownload","contentType":"directory"},{"name":"P267_Upload","path":"Chapter13/P267_Upload","contentType":"directory"},{"name":"P268_ServerPush","path":"Chapter13/P268_ServerPush","contentType":"directory"},{"name":"P268_ServerPushToDisk","path":"Chapter13/P268_ServerPushToDisk","contentType":"directory"},{"name":"P268_ServerPushToMap","path":"Chapter13/P268_ServerPushToMap","contentType":"directory"},{"name":"P269_WebSocket","path":"Chapter13/P269_WebSocket","contentType":"directory"},{"name":".gitignore","path":"Chapter13/.gitignore","contentType":"file"},{"name":"README.md","path":"Chapter13/README.md","contentType":"file"}],"templateDirectorySuggestionUrl":null,"readme":{"displayName":"README.md","richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eThe HTTP Client and WebSocket APIs\u003c/h1\u003e\u003ca id=\"user-content-the-http-client-and-websocket-apis\" class=\"anchor\" aria-label=\"Permalink: The HTTP Client and WebSocket APIs\" href=\"#the-http-client-and-websocket-apis\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis chapter includes 20 problems that are meant to cover the HTTP Client and WebSocket APIs.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eDo you remember \u003ccode\u003eHttpUrlConnection\u003c/code\u003e? Well, JDK 11 comes with the HTTP Client API as a reinvention of \u003ccode\u003eHttpUrlConnection\u003c/code\u003e.\nThe HTTP Client API is easy to use and supports HTTP/2 (default) and HTTP/1.1. For backward compatibility, the HTTP Client API\nwill automatically downgrade from HTTP/2 to HTTP 1.1 when the server doesn't support HTTP/2. Moreover, the HTTP Client API\nsupports synchronous and asynchronous programming models and relies on streams to transfer data (reactive streams). It also\nsupports the WebSocket protocol, which is used in real-time web applications to provide client-server communication with low\nmessage overhead.\u003c/p\u003e\n\u003c/article\u003e","errorMessage":null,"headerInfo":{"toc":[{"level":1,"text":"The HTTP Client and WebSocket APIs","anchor":"the-http-client-and-websocket-apis","htmlText":"The HTTP Client and WebSocket APIs"}],"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fhqtrung01Yuk%2FJava-Coding-Problems%2Ftree%2Fmaster%2FChapter13"}},"totalCount":25,"showBranchInfobar":true},"fileTree":{"":{"items":[{"name":"Chapter01","path":"Chapter01","contentType":"directory"},{"name":"Chapter02","path":"Chapter02","contentType":"directory"},{"name":"Chapter03","path":"Chapter03","contentType":"directory"},{"name":"Chapter04","path":"Chapter04","contentType":"directory"},{"name":"Chapter05","path":"Chapter05","contentType":"directory"},{"name":"Chapter06","path":"Chapter06","contentType":"directory"},{"name":"Chapter07","path":"Chapter07","contentType":"directory"},{"name":"Chapter08","path":"Chapter08","contentType":"directory"},{"name":"Chapter09","path":"Chapter09","contentType":"directory"},{"name":"Chapter10","path":"Chapter10","contentType":"directory"},{"name":"Chapter11","path":"Chapter11","contentType":"directory"},{"name":"Chapter12","path":"Chapter12","contentType":"directory"},{"name":"Chapter13","path":"Chapter13","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"}],"totalCount":16}},"fileTreeProcessingTime":2.561041,"foldersToFetch":[],"treeExpanded":true,"symbolsExpanded":false,"csrf_tokens":{"/hqtrung01Yuk/Java-Coding-Problems/branches":{"post":"uOqCw1_6y25akC1i-S_rFQGpnljFmicsSk5NA4n9JGPFGe2uICndsovaHkcwlEGDrvfRlibpn9I9jdasi-B04g"},"/hqtrung01Yuk/Java-Coding-Problems/branches/fetch_and_merge/master":{"post":"TrBskcaGiAvfuIeFMGvUCa-FnhfM9iSGzyxp6y3rETeMIt0c1t1oWIH0uIfqoSNbjpUQXGPNn4VuH8WBinO3dQ"},"/hqtrung01Yuk/Java-Coding-Problems/branches/fetch_and_merge/master?discard_changes=true":{"post":"_5M_TTKU4TcdK8RwUxSLwkGiEjxMrlDbw5nBjA7FT7k9AY7AIs8BZENn-3KJ3nyQYLKcd-OV69hiqm3mqV3p-w"}}},"title":"Java-Coding-Problems/Chapter13 at master · hqtrung01Yuk/Java-Coding-Problems","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-7d7eb7c71814.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1ae9fa256942.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true,"github_models_repo_integration":false}}}