| [ Web Proxy ] |
| Viewing: https://developers.cloudflare.com/api/resources/snippets/methods/update | [Back] [Original] |
Creates or updates a snippet belonging to the zone.
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYYThe previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
X-Auth-Email: user@example.comThe previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194Snippets Writecurl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/snippets/$SNIPPET_NAME \
-X PUT \
-H 'Content-Type: multipart/form-data' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-F metadata='{"main_module":"main.js"}'{
"errors": [
{
"message": "something bad happened",
"code": 10000
}
],
"messages": [
{
"message": "something bad happened",
"code": 10000
}
],
"result": {
"created_on": "2000-01-01T00:00:00.000000Z",
"snippet_name": "my_snippet",
"modified_on": "2000-01-01T00:00:00.000000Z"
},
"success": true
}{
"errors": [
{
"message": "something bad happened",
"code": 10000
}
],
"messages": [
{
"message": "something bad happened",
"code": 10000
}
],
"result": {
"created_on": "2000-01-01T00:00:00.000000Z",
"snippet_name": "my_snippet",
"modified_on": "2000-01-01T00:00:00.000000Z"
},
"success": true
}| Web Proxy Viewer | New URL | Original Page |