• http post call using http.js

    From Dmxrob@STLWEST to All on Wednesday, February 13, 2019 19:33:43
    Unfortunately I'm not finding http.js to be documented at all. I've been trying to make a .Post call passing in some parameters and it's just not working. Has anyone used http.js to make a .Post call and can shed some light?

    Rob

    dmxrob ■ BBSing from St. Louis, Missouri since 1988

    ---
    ■ Synchronet ■ Gateway to the West - St. Louis, Missouri - bbs.dmxrob.net
  • From echicken@ECBBS to Dmxrob on Friday, February 15, 2019 08:52:44
    Re: http post call using http.js
    By: Dmxrob to All on Wed Feb 13 2019 19:33:43

    Unfortunately I'm not finding http.js to be documented at all. I've been trying to make a .Post call passing in some parameters and it's just not working. Has anyone used http.js to make a .Post call and can shed some

    Would be something like:

    require('http.js', 'HTTPRequest');
    const hr = new HTTPRequest();
    const response = hr.Post('http://some-url', 'some post data');

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-425-5435
    ■ Synchronet ■ electronic chicken bbs - bbs.electronicchicken.com
  • From Dmxrob@STLWEST to echicken on Friday, February 15, 2019 10:03:12
    Re: http post call using http.js
    By: echicken to Dmxrob on Fri Feb 15 2019 08:52 am

    Would be something like:

    require('http.js', 'HTTPRequest');
    const hr = new HTTPRequest();
    const response = hr.Post('http://some-url', 'some post data');

    Yes, that much I have already figured out by looking at http.js.
    Unfortunately, I have not determined if "Some post data" will do URL encoding or if I need to do it first. Is it a string or can it take arrays or data sets? Things of that nature.

    I'll tinker with it more today and probably figure it out. Just thought it might be documented somewhere what the variable types were, etc.

    Rob

    dmxrob ■ BBSing from St. Louis, Missouri since 1988

    ---
    ■ Synchronet ■ Gateway to the West - St. Louis, Missouri - bbs.dmxrob.net
  • From echicken@ECBBS to Dmxrob on Friday, February 15, 2019 11:08:40
    Re: http post call using http.js
    By: Dmxrob to echicken on Fri Feb 15 2019 10:03:12

    Unfortunately, I have not determined if "Some post data" will do URL encoding or if I need to do it first. Is it a string or can it take arrays or data sets? Things of that nature.

    It just takes a string and doesn't transform it in any way, IIRC.

    A good enhancement would be to make it take an object instead of a string,
    to take advantage of keys and values. I can mess around with adding that in later.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-425-5435
    ■ Synchronet ■ electronic chicken bbs - bbs.electronicchicken.com