I have a page that i am posting to and it redirects to another page. I 
understand that most servers will redirect a POST to a GET. How do i catch 
the redirect URL so that i can POST to it. Here is some example code below.

var req = https.request({
    host: 'dashboard.meraki.com',
    path: '/api/v0/networks/1234567/vlans/',
    headers: {
        'x-cisco-meraki-api-key': '12345678'
    },
    method: 'POST'
}, function (response) {
    if (response.statusCode > 300 && response.statusCode < 400) {


    }
    console.log(response.headers);
    response.on('data', (data)=> {
        body += data;
    });
    response.on('end', ()=> {
        response.write(body)
    });
    console.log(response);
});
    req.write('');
    req.end();


Thanks...


Mike

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/0969c55e-efbb-4ff5-bfd6-6459d4c556b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to