Twilio Studio HTTP Post Request Header

不打扰是莪最后的温柔 提交于 2019-12-13 03:25:19

问题


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));

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.

Has anyone done this before? I have reached out to Twilio support but thought I might get lucky here. Thank you


回答1:


It looks like I was not searching correctly as the answer is here:

twilio studio does not allow headers in http requests if the body is JSON



来源:https://stackoverflow.com/questions/57113249/twilio-studio-http-post-request-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!