postman 字符数组_如何使用POSTMAN发布字符串数组?

我正在使用POSTMAN发送字符串数组到web api。在Web API方法看起来像如何使用POSTMAN发布字符串数组?

[HttpPost]

public async Task> GetDocuments([FromBody]IEnumerable documentNames)

{

return await _service.GetDocuments(documentNames);

}

我看到这个SO post这里如何使用邮递员送阵列。所以在这里我是如何发送阵列

提琴手显示请求的内容类型是multipart/form-data;

但我得到错误响应,

{“消息”:“其请求实体的媒体类型'multipart/form-data' 不支持此资源。“,”ExceptionMessage“:”否 MediaTypeFormatter is availabl E要读类型的对象 “的IEnumerable 1' from content with media type 'multipart/form-data'.", "ExceptionType": "System.Net.Http.UnsupportedMediaTypeException",

"StackTrace": " at System.Net.Http.HttpContentExtensions.ReadAsAsync[T](HttpContent content, Type type, IEnumerable 1格式化器,IFormatterLogger formatterLogger,的CancellationToken的CancellationToken个)\ r \ n在 System.Web.Http.ModelBinding.FormatterParameterBinding.ReadContentAsync(HttpRequestMessage 请求,类型类型,IEnumerable`1格式化,IFormatterLogger formatterLogger,的CancellationToken的CancellationToken)”}

我试图设定键作为documentNames,documentNames[],documentNames[0]

我试图选择身体x-www-form-urlencoded。当我这样做时,API收到空集合。

我试过选择身体作为raw当我这样做的API接收null作为参数。

问题

1>如何使用表单数据发送字符串数组?

1>如何使用x-www-form-urlencoded发送字符串数组。 ?

2>如何发送字符串数组作为原始json?

2016-09-23

LP13

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值