Home > Software design >  Flutter - POST request with an xml body
Flutter - POST request with an xml body

Time:12-04

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.

CodePudding user response:

Resolved:

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

  • Related