Lucas Fraga
Lucas Fraga

Reputation: 21

Send XML File through httpRequest using Genexus 17

I am trying to send a XML path in a httprequest. I try in different ways and none works. My last try was:

&Httpclient.Addheader("Content-Type", !"multipart/form-data")
&httpclient.AddVariable('idEmpresa', '123')
&httpclient.AddVariable('senha','abcdfg')
&HttpClient.AddFile('file','.\dadosConciliadora_27-01-2023_09h24m09s697ms.xml')
&HttpClient.Execute(httpmethod.Post, &url)

The message is always "Object reference not set to an instance of an object." Application is based in Java.

I trying send a XML file to a API.

Upvotes: 1

Views: 217

Answers (1)

Lucas Fraga
Lucas Fraga

Reputation: 21

&HttpClient.AddFile('.\dadosConciliadora_27-01-2023_09h24m09s697ms.xml','file')

This resolve the problem.

Upvotes: 1

Related Questions