Answer the question
In order to leave comments, you need to log in
How to send PUT x-www-form-urlencoded in Angular 2?
Good afternoon.
I have such a problem that I need to send a simple PUT request from the Angular 2 front with one {key: value} pair to the back written in Symfony. But I constantly get 404. All I could get from the back-developer is a screenshot from Postman:
But no matter what manipulations I do with sending a request, I get only 404.
send(url) {
let headers = new Headers({'Content-Type': 'application/x-www-form-urlencoded'});
let options = new RequestOptions({ headers: headers });
let data = 'url=' + encodeURIComponent(url);
let data2 = {url: url};
return this.http.put(`${this.apiUrl}`, data);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question