Update client.js

Pass headers too.