lundi 27 juillet 2015

Java - Http Framework to Post XML Files

first of all, I searched for two days in StackOverflow and Google and did not find anything helpful for me. I want to learn Java / JEE and therefore decide to rewrite my JavaScript application build in jQuery, which can send XML files against a REST Api.

Simplified it looks like:

var Core = {
    sendData : function() {
        jQuery.ajax({
            url : "/test",
            method : "POST",
            contentType : "application/xml; charset=utf-8",
            data : JSON.strinigfy(xmlFeed),
            success : function(data) {
                // TODO
            },
            error : function() {
                // TODO
            }
        });
    }
}

I want to build a Java application, which can POST XML files against a REST Api. For the REST Api it is nescessary, that the XML file will be post as Request Payload. I tried Jsoup, but actually it can not send XML files in this way. Is there any Java framework, which makes it easier for me to build my first Java application?

Thanks in advance

Julian

Aucun commentaire:

Enregistrer un commentaire