Change forward method to POST

This commit is contained in:
Kristian Polso 2018-06-15 08:39:11 +03:00
parent 7bc0b794f0
commit fab9f13ff5
4 changed files with 21 additions and 4 deletions

View file

@ -100,7 +100,10 @@ export default {
component.jsonData = '';
component.isLoading = true;
component.exampleCode = '# Example code using the daemon\ncurl \'http://localhost:5279\' --data \'{"method":"resolve","params":{"uri":"' + this.address + '"}}\'';
this.$http.get('https://lbry.tech/forward?method=resolve&uri=' + this.address).then(function(response) {
this.$http.post('https://lbry.tech/forward', {
method: 'resolve',
uri: this.address
}).then(function(response) {
component.isLoading = false;
component.jsonData = JSON.stringify(response.body, null, ' ');
});

View file

@ -202,7 +202,17 @@ export default {
component.isLoading = false;
component.exampleCode = '';
} else {
component.$http.get('https://lbry.tech/forward?method=publish&name=' + component.title + '&bid=0.001&file_path=' + response.filename + '&title=' + component.title + '&description=' + component.description + '&language=' + component.language + '&license=' + component.license + '&nsfw=' + component.nsfw).then(function(response) {
component.$http.post('https://lbry.tech/forward', {
method: 'publish',
name: component.title,
bid: 0.001,
file_path: response.filename,
title: component.title,
description: component.description,
language: component.language,
license: component.license,
nsfw: component.nsfw
}).then(function(response) {
component.isLoading = false;
component.jsonData = JSON.stringify(response.body, null, ' ');
EventBus.$emit('HookFileUploaded', response.body.txid);

View file

@ -102,7 +102,11 @@ export default {
component.jsonData = '';
component.isLoading = true;
component.exampleCode = '# Example code using the daemon\ncurl \'http://localhost:5279\' --data \'{"method":"wallet_send","params":{"claim_id":"' + this.address + '","amount":' + this.amount + '}}\'';
this.$http.get('https://lbry.tech/forward?method=wallet_send&claim_id=' + this.address + '&amount=' + this.amount).then(function(response) {
this.$http.post('https://lbry.tech/forward', {
method: 'wallet_send',
claim_id: this.address,
amount: this.amount
}).then(function(response) {
component.isLoading = false;
component.jsonData = JSON.stringify(response.body, null, ' ');
});

View file

@ -47,7 +47,7 @@ var textParser = bodyParser.text({
limit: '256kb'
});
app.get('/forward', function(req, res) {
app.post('/forward', function(req, res) {
var allowedMethods = ["wallet_send", "resolve", "publish"];