1

I just used node api to access the keosd for wallet lock.

But I've got the following error..

2018-11-12T08:52:24.874 thread-0   http_plugin.cpp:474    
   handle_exception     ] Exception Details: 4 parse_error_exception: Parse Error

Unexpected char '100' in "default"

{"c":100,"s":"default"}

thread-0  json.cpp:437 variant_from_stream

{"str":"default"}

thread-0  json.cpp:460 from_string

What would be wrong?

I also tested in the following site.

https://developers.eos.io/eosio-nodeos/v1.1.0/reference#wallet_lock

Same error..

2 Answers 2

0

I've solved this problem by using the following node.js code. The problem was due to the quotation mark in the message body..

body:"default" => body:"\"default\""

==================

var request = require("request");

var options = { method: 'POST',

url: 'http://127.0.0.1:8899/v1/wallet/lock',

headers: { 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8' },

body:"\"default\""

};

request(options, function (error, response, body) {

if (error) throw new Error(error);

console.log(body);

});

0

This will work too

var request = require("request");

var options = { method: 'POST', url: 'http://127.0.0.1:9999/v1/wallet/lock', headers: { 'cache-control': 'no-cache', 'Content-Type': 'application/json' }, body: 'default', json: true };

request(options, function (error, response, body) { if (error) throw new Error(error);

console.log(body); });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.