Ad

Flutter - POST Request With An Xml Body

- 1 answer

I'm trying to do a POST request on an API with Flutter. I have tried with xml and xml_parser library but I didn't resolve it. I have tried the request with Postman and it works.

The xml document that I have to send is something like this:

<?xml version="1.0" encoding="UTF-8"?>
<p:serviceRequest xmlns:p="http://..." xmlns:xsi="http://..." xsi:schemaLocation="http://... api.xsd">
<info1>...</info1>
      ....
<infoN>...</infoN>
</p:serviceRequest>

How can I send this document with my base URL?

Thanks.

Ad

Answer

Resolved:

I didn't add the header in the POST call specifing the content-type as application/xml

Ad
source: stackoverflow.com
Ad