0
是否可以使用浏览器地址栏中可见的URI与使用HTTP POST的方法?例如,我有一个这样定义的OperationContract
:在HTTP POST中使用URI
[OperationContract, WebInvoke(Method = "POST")]
Stream GetFile(string username, int fileid);
目前,这两个参数都使用POST发送。但是,如果我只想通过POST发送“用户名”并在URI中显示“fileid”,该怎么办?以下工作?
[OperationContract, WebInvoke(Method = "POST", UriTemplate = "GetFile?fileid={fileid}")]
Stream GetFile(string username, int fileid);
即,我想GetFile?fileid={fileid}
在浏览器访问该服务的地址栏是可见的。