I want to perform
cleos create wallet -n <wallet_name>
using an RPC call or any predefined library like eosjs.
EOS version : 1.2.0
OP found their answer, but to give a slightly different answer,
keosd was never recommended for accepting external connections. Using it locally is fine, but once you start making API calls from a machine external to your local network, things can get ugly, as
keosd wasn't designed with this type of security in mind. In other words, your keys may be vulnerable if
keosd can be queried from outside.
keosd does is managing keys, which you should be able to do with
eosjs and a browser application like Scatter. Depending on your usecase, consider that you may not want the RPC calls and there may be a reason why it's not documented.
I found the answer by trying various things posting this answer as a help. So everyone can view this. Ok that is true that wallet_plugin has been removed from the nodeos but kleosd is still using that and we can still perform any rpc of wallet operations suppose your keosd is running on the port 9999 and you want to create a wallet using rpc call you can do that by following operation using curl.
curl -X POST http://127.0.0.1:9999/v1/wallet/create -H 'Cache-Control: no-cache' -H 'Content-Type: application/json' -d '"mywallet"'
For reference you can use https://developers.eos.io/eosio-nodeos/v1.1.0/reference
You can use
Wallet RPC API for any operation that has to be done on a wallet or using the wallet. Please check
] documentation for more details. But keep in mind you have to run
keosd locally for using these RPC API's. For wallet operations, we can't use external API.
keosd can only communicate through your local system. Read
keosd documentation in https://developers.eos.io/keosd/docs/