mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-18 02:35:49 +00:00
Merge pull request #8 from mDuo13/rest_apitool
[FIX] REST tool - correctly wipe req body on command select per DEV-44
This commit is contained in:
@@ -249,15 +249,22 @@ function select_request(request) {
|
||||
//rest_url.val(command.path);
|
||||
rest_url.text(command.path);
|
||||
|
||||
rest_method.val(command.method);
|
||||
rest_method.change();
|
||||
|
||||
|
||||
if (command.method == POST || command.method == PUT) {
|
||||
//first show the request, then set its contents
|
||||
rest_method.val(command.method);
|
||||
rest_method.change();
|
||||
cm_request.setValue(JSON.stringify(command.body, null, 2));
|
||||
} else {
|
||||
//No body, so wipe out the current contents.
|
||||
//This prevents confusion if the user toggles the HTTP method dropdown
|
||||
cm_request.setValue("");
|
||||
|
||||
//cm_request.setValue() doesn't work if the element is hidden,
|
||||
// so wait until now to hide cm_request
|
||||
rest_method.val(command.method);
|
||||
rest_method.change();
|
||||
}
|
||||
|
||||
reset_response_area();
|
||||
|
||||
Reference in New Issue
Block a user