Twilio Studio HTTP Post 请求标头 [英] Twilio Studio HTTP Post Request Header
问题描述
我正在尝试使用 Http 请求小部件,内容类型 - 应用程序/json.我没有看到添加请求标头以提供令牌的选项.此 .Net 代码获得成功响应:
I am trying to use the Http Request Widget, content type - application/json. I do not see an option to add a request header to supply a token. This .Net code gets a success response:
string str = "Hello Webservice";
string url = "https://website.com/webserviceurl.php";
HttpClient httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Add("token", "xxxx");
HttpResponseMessage response = await httpClient.PostAsync(url, new StringContent(str));
在 Twilio Studio 中,我尝试将内容类型设置为 url 编码形式,以便我可以将我的令牌添加为参数,但这不起作用.我收到了 500 条回复.
In Twilio Studio I tried setting the content type to form url encoded so that I could add my token as a parameter but that didn't work. I got a 500 response.
以前有人做过吗?我已经联系了 Twilio 支持,但我想我可能会在这里走运.谢谢
Has anyone done this before? I have reached out to Twilio support but thought I might get lucky here. Thank you
推荐答案
看起来我没有正确搜索,因为答案在这里:
It looks like I was not searching correctly as the answer is here:
twilio如果正文是 JSON,工作室不允许 http 请求中的标头
这篇关于Twilio Studio HTTP Post 请求标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!