I try to dowload a file by a Api .
I have no error and a response with "OK" but i don't see the file.
Have i donwloaded it ? where ? can i set up the local directory where save it ?
This is my code : ( a big doubt is in content-Type )
Dim _command As String
_command = "https://content.dropboxapi.com/2/files/download"
Dim Request As HttpWebRequest
Request = HttpWebRequest.Create(_command)
Request.Method = "POST"
Request.KeepAlive = True
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 Or SecurityProtocolType.Tls12 Or SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls
Request.ContentType = "application/octet-stream"
Request.UserAgent = "Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36"
ServicePointManager.SecurityProtocol = CType(48, SecurityProtocolType) Or CType(192, SecurityProtocolType) Or CType(768, SecurityProtocolType) Or CType(3072, SecurityProtocolType)
Request.AllowAutoRedirect = True
Request.Headers.Add("Authorization", "Bearer " & _token)
Request.Headers.Add("Dropbox-API-Arg", _parameter)
Try
Dim Response As HttpWebResponse = Request.GetResponse()
Catch ex As WebException
Using response = CType(ex.Response, HttpWebResponse)
Using reader = New IO.StreamReader(response.GetResponseStream())
_error = reader.ReadToEnd()
End Using
End Using
Catch ex As Exception
Throw
End Try