Skip to content

REST: Baking macaroon array lnrpcMacaroonPermission type #6786

Discussion options

You must be logged in to vote

I just tried successfully running:

axios({
  method: 'POST',
  url: "https://localhost:8091/v1/macaroon",
  headers: {
    'Grpc-Metadata-macaroon': macaroon,
    'Content-Type': 'application/json'
  },
  data: {"permissions": [{"entity": "offchain", "action": "read"}]},
  withCredentials: false,
  httpsAgent: new https.Agent({  
    rejectUnauthorized: false
  })
}).then(function (response: any) {
  console.log(response.data);
}).catch(function (error: any) {
  console.log(error);
});

// returns
// {
//     macaroon: '0201036...'
// }

NOTE: Using body did not work for me, instead I was using data.
I also just tried axios for the first time, so I'm unsure of all intermediate steps you ar…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@bennyhodl
Comment options

Answer selected by bennyhodl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
Converted from issue

This discussion was converted from issue #6772 on August 01, 2022 08:01.