Copy link to clipboard
Copied
Can anyone give me an example request to send transient docment using API v6. I have been trying eveything I can think of and all I get is The remote server returned an error: (415) Unsupported Media Type
I'll take the request in C# or vb.net.
This does not work
objRequest = WebRequest.Create(URI)
objRequest.Method = "POST"
objRequest.Headers.Add("Authorization", String.Format("Bearer {0}", RESTAPIKey))
objRequest.Headers.Add("Content-Disposition", String.Format("form-data;File-Name={0};File={1}", fileInfo.Name, fileInfo.FullName))
objRequest.Headers.Add("Mime-Type", "application/pdf")
Dim fs As New System.IO.FileStream(fileInfo.FullName, FileMode.Open, FileAccess.Read)
fileBytes = New Byte(fs.Length) {}
fs.Read(fileBytes, 0, fs.Length)
sw = objRequest.GetRequestStream
sw.Write(fileBytes, 0, fileBytes.Length)
'sw.Write(postbytes, 0, postbytes.Length)
sw.Close()
Dim objResponse As HttpWebResponse = CType(objRequest.GetResponse(), HttpWebResponse)
objResponse = objRequest.GetResponse()
Copy link to clipboard
Copied
hi, were you able to figure out what was wrong with this. I am sort of stuck in the same boat.
Copy link to clipboard
Copied
Did you able to solve this. If so what s solution? I am facing same issue.