mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
feat: update ApiRequest to accept POST w/o payloads
This commit is contained in:
parent
9a0226d158
commit
65da8a845a
@ -31,6 +31,13 @@ POST.args = {
|
||||
title: 'Create a feature toggle with impression data enabled. (example)',
|
||||
};
|
||||
|
||||
export const POSTWithoutPayload = Template.bind({});
|
||||
POSTWithoutPayload.args = {
|
||||
verb: 'post',
|
||||
url: 'api/admin/projects/<projectId>/features/<featureName>/environments/<environment>/on',
|
||||
title: 'Disable a toggle in an env.',
|
||||
};
|
||||
|
||||
export const PUT = Template.bind({});
|
||||
PUT.args = {
|
||||
verb: 'put',
|
||||
|
@ -68,6 +68,9 @@ curl -H "Content-Type: application/json" \\
|
||||
<${baseUrl}>/${url}`
|
||||
).trim();
|
||||
|
||||
const httpieBlockFormatSpecifier =
|
||||
verbUpper === 'POST' && !prettyPayload ? '--json' : '';
|
||||
|
||||
const httpieBlock = (
|
||||
payload
|
||||
? `echo '${prettyPayload}' \\
|
||||
@ -77,7 +80,8 @@ curl -H "Content-Type: application/json" \\
|
||||
: `
|
||||
http ${verbUpper} \\
|
||||
<${baseUrl}>/${url} \\
|
||||
Authorization:<${authToken}>`.trim()
|
||||
Authorization:<${authToken}> \\
|
||||
${httpieBlockFormatSpecifier}`.trim()
|
||||
).trim();
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user