Rename `HttpCommunication.ExecPost` and add docs
This commit is contained in:
parent
88c54d11b6
commit
08dd34f42b
|
@ -32,7 +32,17 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public string ExecGet(string url = null) => Get(url ?? GetUrl).Result;
|
public string ExecGet(string url = null) => Get(url ?? GetUrl).Result;
|
||||||
|
|
||||||
|
/// <inheritdoc cref="ExecPostAsForm"/>
|
||||||
|
[Obsolete($"renamed to {nameof(ExecPostAsForm)}")]
|
||||||
public string ExecPost(string url = null, string payload = "")
|
public string ExecPost(string url = null, string payload = "")
|
||||||
|
=> ExecPostAsForm(url: url, payload: payload);
|
||||||
|
|
||||||
|
#pragma warning disable DOC105 // false positive detecting param name in doc comment
|
||||||
|
/// <remarks>
|
||||||
|
/// uses <see cref="FormUrlEncodedContent"/> (<c>application/x-www-form-urlencoded</c>),
|
||||||
|
/// containing a single pair with key <c>payload</c> (literal) and value <paramref name="payload"/> (argument)
|
||||||
|
/// </remarks>
|
||||||
|
public string ExecPostAsForm(string url = null, string payload = "")
|
||||||
{
|
{
|
||||||
return Post(
|
return Post(
|
||||||
url ?? PostUrl,
|
url ?? PostUrl,
|
||||||
|
@ -40,6 +50,7 @@ namespace BizHawk.Client.Common
|
||||||
sendAdvanceRequest: payload.Length >= ExpectContinueThreshold
|
sendAdvanceRequest: payload.Length >= ExpectContinueThreshold
|
||||||
).Result;
|
).Result;
|
||||||
}
|
}
|
||||||
|
#pragma warning restore DOC105
|
||||||
|
|
||||||
public async Task<string> Get(string url)
|
public async Task<string> Get(string url)
|
||||||
{
|
{
|
||||||
|
|
|
@ -200,7 +200,7 @@ namespace BizHawk.Client.Common
|
||||||
public string HttpPost(string url, string payload)
|
public string HttpPost(string url, string payload)
|
||||||
{
|
{
|
||||||
CheckHttp();
|
CheckHttp();
|
||||||
return APIs.Comm.HTTP?.ExecPost(url, payload);
|
return APIs.Comm.HTTP?.ExecPostAsForm(url: url, payload: payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
[LuaMethod("httpPostScreenshot", "HTTP POST screenshot")]
|
[LuaMethod("httpPostScreenshot", "HTTP POST screenshot")]
|
||||||
|
|
Loading…
Reference in New Issue