VERB *具有WCF自托管休息服务的HTTP/1.1 [英] VERB * HTTP/1.1 with WCF self hosted rest service

查看:70
本文介绍了VERB *具有WCF自托管休息服务的HTTP/1.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要求启用带有WCF自托管Rest(XML)服务的VERB * HTTP/1.1.

I have the requirement for enable VERB * HTTP/1.1 with WCF self-hosted Rest (XML) service.

我的服务正在使用VERB/HTTP/1.1,但我需要使用"*"而不是"/"使用wcf服务,当我将OPTIONS用作动词时,效果很好.但我想对某些自定义动词提供相同的支持.

My service is working with VERB / HTTP/1.1 but I need to use "*" instead of "/" with wcf service and when I use OPTIONS as the verb it works fine. But I want to give same support for some Custom Verbs.

当我尝试使用以下请求格式通过python客户端使用服务时,它工作正常.

While I am trying to consume service with python client using below request format it is working fine.

请求

MYVERB / HTTP/1.1 HOST: 127.0.0.1:8000 EXT: MY_APP

/ 1.1 主机 : . 0.1 : 8000 EXT

OPTIONS/ HTTP/1.1 HOST: 127.0.0.1:8000 EXT: MY_APP

响应

Response

<?xml version="1.0" encoding="utf-8"?><MyXML status="0" info="my demo service"></MyXML>

但是在使用以下请求格式时,HTTP状态为400(错误请求)的错误消息

but while using the request format as below it is giving error with HTTP Status 400 (Bad Request)

请求

MYVERB * HTTP/1.1
HOST: 127.0.0.1:8000
EXT: MY_APP

响应

Response

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01// EN""http://www.w3.org/TR/html4/strict.dtd">\r\n<HTML><HEAD><TITLE>Bad Request</T ITLE>\r\n<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii">< /HEAD>\r\n<BODY><h2>Bad Request - Invalid URL</h2>\r\n<hr><p>HTTP Error 400. The request URL is invalid.</p>\r\n</BODY></HTML>\r\n')

推荐答案

您见过任何地方或任何地方文件用"*"描述此请求吗?根据我的经验,我没有.并检查后 http URL ,没有这样的定义.

Have you seen anywhere or any document describe this request with "*"? From my experience, I do not. And after checking http URL, there is no such definition.

您能否与我们分享URL中"*"的目的?

Could you share us what the purpose of "*" in URL?

根据我的选择,这是一个无效的URL(错误指示).

In my option, this is an invalid URL as the error indicates.


这篇关于VERB *具有WCF自托管休息服务的HTTP/1.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆