使用自定义值列举HTTPMethod [英] Using a custom value for HttpMethod

查看:612
本文介绍了使用自定义值列举HTTPMethod的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了的HttpClient ,我需要设置一个非标准型为列举HTTPMethod 。凡使用的HttpWebRequest 只需要一个字符串,的HttpClient 预计的列举HTTPMethod 。在列举HTTPMethod 列举可用值,我没有看到一个方法来添加自定义的。有什么想法?

I'm using the HttpClient and I need to set a non-standard type for the HttpMethod. Where using HttpWebRequest only expects a string, HttpClient expects an HttpMethod. Enumerating the available values in HttpMethod, I don't see a way to add a custom one. Any thoughts?

推荐答案

不知道为什么我没有想到尝试之前这一点,但我可以叫新列举HTTPMethod(myMethod的);

Don't know why I didn't think of trying this before, but I can call new HttpMethod("MYMETHOD");

这篇关于使用自定义值列举HTTPMethod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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