Question

Our server A notifies 3rd party server B with an XML-formatted message, sent as HTTP POST request. It's us who specify the message format and other aspects of interaction. We can specify that the XML is sent as

a) raw data (just the XML)

b) single POST parameter having some specific name (say, xml=XML)

The question is which way is better for the 3rd party in general, if we don't know the platform and language they are using.

I thought I had seen some problems in certain languages to easily parse the nameless raw data, though I don't remember any specific case. While my colleague insists that the parameter name is redundant, and it's really better to send the raw data without any name.

Was it helpful?

Solution

If you don't need send extra information in other post parameters the xml parameter name is redundant and innecesary as your teammate said, if the 3rd party waits only for a XML data only send the raw data in the POST body with the correct mime type and encoding and and do not complicate.

The process for Getting raw data is easy in most application server containers, so you dont care about that, most of them uses a Reader to get received data and manipulate it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top