I write a login script with request-promie, and want to get a "location" value in response.header
when i write as below with right params(right username and password), i can get the date i want (res.header.location) in rp().catch(res => res.header.location)
when i write as below with wrong params(wrong username or password), i can not anything because no method be called(neithor rp().then() or re().catch() was be call, re().finaly() isnot work ).
I write a login script with request-promie, and want to get a "location" value in response.header
when i write as below with right params(right username and password), i can get the date i want (res.header.location) in
rp().catch(res => res.header.location)
when i write as below with wrong params(wrong username or password), i can not anything because no method be called(neithor
rp().then()
orre().catch()
was be call,re().finaly()
isnot work ).i want to do something when i get the wrong params, how can i catch it.