Sending XML to JAVA - Angular 2

Asked

Viewed 36 times

1

Guys, I’m trying to send an XML from my Angular 2 view to a Java backend. In java I have a Servlet that searches the xml for the parameter:

request.getParameter("xml")

And in my angular service I’m doing it this way:

let urlSearchParams = new URLSearchParams();

urlSearchParams.append('xml', params);

let body = urlSearchParams.toString();

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

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

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.