fdaciuk/ajax

Send [object object] from method PUT

Closed this issue · 4 comments

Hi @fdaciuk, i`m try to send a object to endpoint, but the network in browser show [object object].

my code:

  let url = 'http://localhost:3000/api'
  let request = (param, data) = ajax({
    method: "put",
    url: url + param,
    data: data,
  }); 

  request(`/users/1`, { driverDocument: { status: 2 } }).then()

Network

captura de tela 2018-06-19 as 09 15 46

Hey @nicholasess! It's definitely a bug :
The library is ready to accept an object with just one level.

I'll fix it =)

Nice man, i always use the library, but i changed to axios in project to finish my job. When you fixed it, tell me about.

Thanks

@nicholasess can you try it again with new version?

I'll close this issue because the problem was already solved. But if you want any other trouble, just let me know =)