SDK可指定requestMethod

This commit is contained in:
tanghc
2019-05-28 11:08:50 +08:00
parent 4bd3869ed8
commit cb6bdcc22c
10 changed files with 116 additions and 78 deletions

View File

@@ -8,33 +8,33 @@ namespace SDKCSharp.Common
{
public class RequestForm
{
private Dictionary<string, string> form;
/// <summary>
/// 请求表单内容
/// </summary>
public Dictionary<string, string> Form
{
get { return form; }
set { form = value; }
}
private List<UploadFile> files;
public Dictionary<string, string> Form { get; set; }
/// <summary>
/// 上传文件
/// </summary>
public List<UploadFile> Files
{
get { return files; }
set { files = value; }
}
public List<UploadFile> Files { get; set; }
/// <summary>
/// 指定或者设置字符集
/// </summary>
/// <value>The charset.</value>
public Encoding Charset { get; set; }
/// <summary>
/// 指定或设置HTTP请求method
/// </summary>
/// <value>The request method.</value>
public RequestMethod RequestMethod { get; set; } = RequestMethod.POST;
public RequestForm(Dictionary<string, string> form)
{
this.form = form;
this.Form = form;
}
}
}

View File

@@ -0,0 +1,8 @@
using System;
namespace SDKCSharp.Common
{
public enum RequestMethod
{
GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE
}
}