通过URL传递的双/浮到网页API查询字符串 [英] Passing double/float through URL to Web Api query string
本文介绍了通过URL传递的双/浮到网页API查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我得到了一个Web API项目,我想打电话给通过此URL的API控制器:
I got a Web Api project, and I want to call a api controller through this URL:
Http://localhost:3030/GetByCoordinates/[[0,1],[1,1],[1,0],[0,0]]
它工作正常,但是当我尝试添加双号(如1.1,而不是1)浏览器抛出404未发现异常,因为该点使它看起来像另一个地址。
It works fine, but when I try to add a double number (like 1.1 instead of 1) the browser throws 404 not found exception, because the dot make it look like another address.
我该如何处理双打?
推荐答案
尝试添加/在URL的末尾,例如
Try adding '/' at the end of the URL, e.g.
Http://localhost:3030/GetByCoordinates/[[0,1],[1,1.1],[1,0],[0,0]]/
参考:<一href=\"http://stackoverflow.com/questions/21387974/why-is-my-web-api-method-with-double-args-not-getting-called\">Why我是双ARGS的Web API方法没有得到所谓的?
这篇关于通过URL传递的双/浮到网页API查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文