vb.net - (415) Unsupported Media Type while posting envelopes in DocuSign -


i getting error while trying post envelope:

(415) unsupported media type

here code:

dim httpwebrequest =     directcast(webrequest.create("https://demo.docusign.net/restapi/v2/accounts/1005732/envelopes"), httpwebrequest)  httpwebrequest.contenttype = "text/json" httpwebrequest.method = "post" httpwebrequest.accept = "text/json" httpwebrequest.mediatype = "text/json"  httpwebrequest.headers.add("x-docusign-authentication", "{""username"": ""myuser"",""password"": ""mypassword"",""integratorkey"": ""mykey""}")  using streamwriter = new streamwriter(httpwebrequest.getrequeststream()) dim json string = "{""status"": ""sent"",""emailblurb"": ""test email body"",""emailsubject"": ""test email subject"",""documents"": [{""name"":   ""c:\ant.htm"",""documentid"": ""1"",""order"": ""1""}],""recipients"":    {""signers"": [{""email"": ""eladrozman@gmail.com"",""name"":    ""elad"",""recipientid"": ""1"",""tabs"": {""signheretabs"": [{""xposition"": ""100"",""yposition"": ""100"",""documentid"": ""1"",""pagenumber"": ""1""}]}}]}}"  streamwriter.write(json) end using  dim httpresponse = directcast(httpwebrequest.getresponse(), httpwebresponse) 

there's no such media type text/json. need use application/json content-type , other headers.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -