'XML file submission via API
Good afternoon guys, I'm sending a POST request to an endpoint and in it I should send an xml file, but I'm returning a strange error, following the code is like this:
Public Function enviaxmlporto(ByVal diretorioXML As String, ByRef antt As String) As Boolean
Try
Dim client = New RestClient("*****")
client.Timeout = -1
Dim request = New RestRequest(Method.POST)
request.AddHeader("Cookie", "portal[ses]=ab7478aed1848f085c6b3f61830258cc")
request.AddHeader("Content-Type", "multipart/form-data")
request.AddParameter("comp", "5")
request.AddParameter("mod", "Upload")
request.AddParameter("path", "eguarda/php/")
request.AddFile("file","/C:/XMLaverbeporto/35220157460644000180550010008195051001305730.XML");
Dim response As IRestResponse = client.Execute(request)
Console.WriteLine(response.Content)
Catch ex As Exception
End Try
End Function
when I make the request it is returning the following exception
The given path format is not supported.
Can anyone tell me why this error?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
