Sending XML to JAVA - Angular 2

1

Well, I'm trying to send an XML from my view in Angular 2 to a Java backend. In the java I have a servlet that looks for the xml by the parameter:

request.getParameter("xml")

And in my angular service I'm doing the following:

let urlSearchParams = new URLSearchParams();

urlSearchParams.append('xml', params);

let body = urlSearchParams.toString();

return this._http.post(url, body).map(this.extractJson);

Where params is the xml, which comes as a function parameter. The URL is correct, debugging the Java I get the request but the parameter comes null. Is something wrong I'm doing?

    
asked by anonymous 23.02.2018 / 19:09

0 answers