You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The API interface works fine if you know the request number, but the html body is easier to identify by the bodyid tag, which is not supported by the current API.
The following is an update to the getResponseBody code the enables both request and bodyid as options
function getResponseBody(id, options, callback) {
// WSI Mod - enables any parm to be parsed eg bodyid
var query;
let temp = options ; // WSI Mod - addition of temp
callback = callback || options;
options = options === callback ? {} : options;
options.args = options.args || {type: 'text/plain'};
query = setFilename({test: id}, options);
query.request = options.request || 1;
let merged = {}; // WSI Mod - addition of temp obj
Object.assign(merged, query, temp); // WSI Mod - merge original and new options
query = merged ; // WSI Mod - reload query
return api.call(this, paths.responseBody, callback, query, options);
}
Nothing else changes except in the call options={bodyid: xxxxxxxxxxxxxxxxxxxxxx} where xxxxxxxxxxxx is the bodyid now returns the html body. Request still works as expected.
Am running this as a local mod at the moment but would be appreciated if this could be included in a future API upgrade.
Regards
Phil
The text was updated successfully, but these errors were encountered:
The API interface works fine if you know the request number, but the html body is easier to identify by the bodyid tag, which is not supported by the current API.
The following is an update to the getResponseBody code the enables both request and bodyid as options
function getResponseBody(id, options, callback) {
// WSI Mod - enables any parm to be parsed eg bodyid
var query;
let temp = options ; // WSI Mod - addition of temp
callback = callback || options;
options = options === callback ? {} : options;
options.args = options.args || {type: 'text/plain'};
query = setFilename({test: id}, options);
query.request = options.request || 1;
}
Nothing else changes except in the call options={bodyid: xxxxxxxxxxxxxxxxxxxxxx} where xxxxxxxxxxxx is the bodyid now returns the html body. Request still works as expected.
Am running this as a local mod at the moment but would be appreciated if this could be included in a future API upgrade.
Regards
Phil
The text was updated successfully, but these errors were encountered: