anjun-xy

在Postman用post方式请求webapi

post方式访问webapi(参数巨大)

  • 具体postman设置见图,其他tabs默认就好。选raw后贴入键值对diagnosisTable=[...]选post点send即可。

怎么格式化返回的json? 选json即可


不用postman自己用jQuery实现一个post请求工具

  • 让chrome支持跨域访问:

chrome图标上右键属性的目标改成"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir=D:\work\chromeTemp\

  • 然后在跨域chrome中访问如下页面,注意api改成自己的,内容格式a=123&b=123
<head>
<meta charset="utf-8">
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
	$("button").click(function(){
		$(\'#div1\').html(\'发送成功!\');
		var a=$(\'#a\').val();
		var b=$(\'#b\').val();
		 $.post(
			a,
			b ,
			function(rlt,status,xhr){
				$(\'#div1\').html(rlt); 
		})   
	});
});
</script>
api:<input type=\'text\' style=\'width:1010px\' id=\'a\' value=\'http://localhost:5383/webapi/SysMgr/GetSrvDateTime\'/><br> <br> 
post内容:<br> 
<textarea rows="20" cols="150" id=\'b\'></textarea><br> <br> 
	<div id=\'div1\'>执行结果</div> 
</head>
<body> 
<button>发送POST请求</button>

postman发起soap请求(调用webservice接口)

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-08-26
  • 2021-06-14
  • 2022-12-23
  • 2022-12-23
  • 2021-06-23
  • 2021-07-10
  • 2022-02-07
猜你喜欢
  • 2021-09-09
  • 2022-02-07
  • 2022-12-23
  • 2021-07-12
  • 2021-05-22
  • 2021-05-20
  • 2022-12-23
相关资源
相似解决方案