1

I need to send an XML using an API (Post Method) But don't have an idea of how to convert an OBJECT CLASS in Dart to this XML and then send it to API.

1 Answer 1

1

I've done something similar before. You can either learn how to write XML or use a shortcut - convert to JSON then convert to XML. So you convert your Dart class into JSON then convert JSON to XML using this XML library

This question shows how to create a JSON object in flutter - Flutter Post JSON
This question shows how to convert JSON to XML using Dart's XML library - Flutter JSON to XML

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.