{"id":18854856,"url":"https://github.com/noear/uwp-async-http","last_synced_at":"2025-04-14T10:43:24.066Z","repository":{"id":145378893,"uuid":"46696076","full_name":"noear/uwp-async-http","owner":"noear","description":"noear::Windows.Web.Http 的简化封装（AsyncHttpClient）","archived":false,"fork":false,"pushed_at":"2015-12-12T01:33:07.000Z","size":55,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T11:38:38.085Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.noear.org","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noear.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-23T04:13:27.000Z","updated_at":"2018-10-31T02:12:26.000Z","dependencies_parsed_at":"2023-04-15T15:44:35.833Z","dependency_job_id":null,"html_url":"https://github.com/noear/uwp-async-http","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noear%2Fuwp-async-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noear%2Fuwp-async-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noear%2Fuwp-async-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noear%2Fuwp-async-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noear","download_url":"https://codeload.github.com/noear/uwp-async-http/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248867605,"owners_count":21174748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T03:51:58.214Z","updated_at":"2025-04-14T10:43:24.011Z","avatar_url":"https://github.com/noear.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# uwp-async-http\n\n在使用Windows.Web.Http时，觉得涉及Cookie及编码操作时比较麻烦\n所以就封装了AsyncHttpClient\n\n文件结构：\n```javascript\nNoear.UWP.Http{\n    AsyncHttpClient\n    AsyncHttpResponse\n}\n```\n\n示例代码：\n```java\n//GET DEMO\nvar rsp = await new AsyncHttpClient().Url(\"http://api.xxx.ddd/get\")\n    .Encoding(\"UTF-8\")\n    .Get();\n\nreturn rsp.GetString();\n\n//Request HttpHeader,Cookie DEMO\nvar rsp = await new AsyncHttpClient().Url(\"http://api.xxx.ddd/get\")\n    .Referer(referer)\n    .UserAgent(\"xxxxxxxxxx\")\n    .Cookies(\"userID=1\")\n    .Get();\n\nreturn rsp.GetBytes();\n\n//POST DEMO\nDictionary\u003cstring, string\u003e postData = new Dictionary\u003cstring, string\u003e();\npostData.Add(\"OrderID\", \"1\");\n\nvar rsp = await new AsyncHttpClient().Url(\"http://api.xxx.ddd/post\")\n    .Post(postData);\n\nreturn rsp.GetString();\n\n//Response DEMO\nDictionary\u003cstring, string\u003e postData = new Dictionary\u003cstring, string\u003e();\npostData.Add(\"OrderID\", \"1\");\n\nvar rsp = await new AsyncHttpClient().Url(\"http://api.xxx.ddd/post\")\n    .Post(postData);\n\nif (rsp.StatusCode == HttpStatusCode.Ok) {\n    string text = rsp.GetString();\n    string name = rsp.Headers[\"name\"];\n    string cokie = rsp.Cookies;\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoear%2Fuwp-async-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoear%2Fuwp-async-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoear%2Fuwp-async-http/lists"}