3

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

JJJ
  • 32,902
  • 20
  • 89
  • 102
Joe C
  • 3,925
  • 2
  • 11
  • 31

1 Answers1

3

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

Joe C
  • 3,925
  • 2
  • 11
  • 31