拡張子:txtvbswsfjsphpjavahtmlutf8sjis String url = "http://localhost/kouki_kadai/server.php?type=one&id=0005"; try { HttpClient httpClient = new HttpClient(); httpClient.MaxResponseContentBufferSize = int.MaxValue; httpClient.DefaultRequestHeaders.ExpectContinue = false; HttpResponseMessage response = await httpClient.GetAsync(url); String text = await response.Content.ReadAsStringAsync(); Debug.WriteLine(text); } catch (Exception Err) { Debug.WriteLine(Err.Message); }
String url = "http://localhost/kouki_kadai/server.php?type=one&id=0005"; try { HttpClient httpClient = new HttpClient(); httpClient.MaxResponseContentBufferSize = int.MaxValue; httpClient.DefaultRequestHeaders.ExpectContinue = false; HttpResponseMessage response = await httpClient.GetAsync(url); String text = await response.Content.ReadAsStringAsync(); Debug.WriteLine(text); } catch (Exception Err) { Debug.WriteLine(Err.Message); }
拡張子:txtvbswsfjsphpjavahtmlutf8sjis String url = "http://localhost/kouki_kadai/server.php"; try { HttpClient httpClient = new HttpClient(); httpClient.MaxResponseContentBufferSize = int.MaxValue; httpClient.DefaultRequestHeaders.ExpectContinue = false; // POSTで送信されるデータをセットする HttpContent content = new FormUrlEncodedContent(new Dictionary<string, string> { { "type", "dml" }, { "query", "update アニメ set FF = 1 where ID= '0001'" } }); HttpResponseMessage response = await httpClient.PostAsync(url, content); String text = await response.Content.ReadAsStringAsync(); Debug.WriteLine(text); } catch (Exception Err) { Debug.WriteLine(Err.Message); }
String url = "http://localhost/kouki_kadai/server.php"; try { HttpClient httpClient = new HttpClient(); httpClient.MaxResponseContentBufferSize = int.MaxValue; httpClient.DefaultRequestHeaders.ExpectContinue = false; // POSTで送信されるデータをセットする HttpContent content = new FormUrlEncodedContent(new Dictionary<string, string> { { "type", "dml" }, { "query", "update アニメ set FF = 1 where ID= '0001'" } }); HttpResponseMessage response = await httpClient.PostAsync(url, content); String text = await response.Content.ReadAsStringAsync(); Debug.WriteLine(text); } catch (Exception Err) { Debug.WriteLine(Err.Message); }