How to use the popsicle.put function in popsicle

To help you get started, we’ve selected a few popsicle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LiskHQ / lisk-sdk / test / integration / utils / http.js View on Github external
enableForging(keys, port, ip) {
		return popsicle
			.put({
				url: endpoints.versions[currentVersion].enableForging(
					ip || '127.0.0.1',
					port || 4000
				),
				headers,
				body: {
					password: 'elephant tree paris dragon chair galaxy',
					publicKey: keys.publicKey,
					forging: true,
				},
			})
			.then(res => {
				if (res.status !== apiCodes.OK) {
					throw new Error(
						`Failed to enable forging for delegate with publicKey: ${
github LiskHQ / lisk-sdk / test / integration / peers.integration.js View on Github external
testNodeConfig.delegates.forEach(keys => {
			var enableForgingPromise = popsicle.put({
				url: `http://${testNodeConfig.ip}:${testNodeConfig.wsPort -
					1000}/api/node/status/forging`,
				headers: {
					Accept: 'application/json',
					'Content-Type': 'application/json',
				},
				body: {
					password: 'elephant tree paris dragon chair galaxy',
					publicKey: keys.publicKey,
				},
			});
			enableForgingPromises.push(enableForgingPromise);
		});
	});