1

Reading Superagent documentation, There is no distinguish between POST & PUT request :

  request.post('/user')
    .set('Content-Type', 'application/json')
    .send('{"name":"tj","pet":"tobi"}')
    .end(callback)

How to do PUT request using this package ?

Abdennour TOUMI
  • 87,526
  • 38
  • 249
  • 254
  • 1
    from docs: "DELETE, HEAD, POST, PUT and other HTTP verbs may also be used, simply change the method" – num8er Oct 07 '16 at 16:23

1 Answers1

6

DELETE, HEAD, POST, PUT and other HTTP verbs may also be used, simply change the method name.

So,

request.put('/user')
    .set('Content-Type', 'application/json')
    .send('{"name":"tj","pet":"tobi"}')
    .end(callback)
ʰᵈˑ
  • 11,279
  • 3
  • 26
  • 49