【发布时间】:2017-09-27 14:50:04
【问题描述】:
我正在尝试将 Buffer[] 从 typescript 发送到 C# 中的端点,以操纵接收到的文件,如下所示:
.TS:
let goiaba = new Buffer("I'm a string!", "utf-8")
params.path = "File/UploadSync2";
let path = params.getRequestParams();
let uri = `${this.baseUrl}/${path}`;
let options = {
method: 'POST',
url: uri,
headers: params.header,
form: {goiaba}
};
options.headers['Content-Type'] = 'application/x-www-form-urlencoded';
return requestAsync.postAsync(options);
C# 端点:
public Result<PutObjectResponse> UploadSync2(byte[] goiaba)
{
return null;
}
问题是 goiaba 正在接收 {byte[0]}。 我该怎么做?
【问题讨论】:
-
只是个小插曲,但你试过把参数改成
string goiaba吗? -
是的,但没有成功
-
这与 TypeScript 无关。
-
我知道...你有什么想法吗?
标签: c# file typescript byte buffer