Похожие чаты

Hey all, I try to post json to server in

my angular 4 app.

onSubmit(value){

let data = {"name":value["name"],"email":value["email"],"password":" "}

this.userService.Register(data).subscribe(
data => {
console.log(data);
}
)
but server recive some things like this, not JSON format
{ '{\n "name": "sdsdsds@dkfd.cc",\n "email": "nuhag@storj99.com",\n "password": " "\n}': '' }

Or if use JSON.stringify it will be
{ '{"name":"jds","email":"mail@mail.com","password":""}': '' }

any way to sending data as json to server in angular?

2 ответов

4 просмотра

the second thing { '{"name":"jds","email":"mail@mail.com","password":""}': '' } is a valid JSON i guess

Are making it JSON before sending it?

Похожие вопросы

Обсуждают сегодня

Карта сайта