I am sending a post request to the backend with just one input field and I able to display my request in console as "request". But the backend is expecting the request to be in an array like this ["request"].
Asked
Active
Viewed 56 times
0
-
Have you tried `return this._http.post
(this._url, Array(userData));` – Reez0 Nov 13 '20 at 14:45
2 Answers
0
Change this line:
this.verifyService.verify(this.hashForm.value)
To this:
this.verifyService.verify([this.hashForm.value])

Mathew Berg
- 28,625
- 11
- 69
- 90
-
Thanks for answering Mathew, but it didn't work, it gives me the same output in console. Any other suggestions? – Navdeep Nov 13 '20 at 14:38
0
You can do something like this if your backend expects only string[]
value and your form has only one input.
this.verifyService.verify([this.hashForm.controls.contentHash.value])

firatozcevahir
- 892
- 4
- 13