Anypoint Best Practices

(14 reviews)

standard-put-status-codes

general > standard-put-status-codes


Guidance

Avoid non-standard status codes for PUT operations.

Message

The following response codes should be used as standard for PUT operations: 200,202,204,400,401,403,404,405,406,408,409,410,412,415,429,500,502,503,504,509,510,511,550,598,599. Avoid not defined return codes.

Examples

valid

#%RAML 1.0
title: example api
version: 1.0.0
/events:
  put:
    description: Gets a stream of report results
    responses:
      200: # Valid status code
          description: Ok!
          body:
            application/json:
              type: string
              example: Hello!

invalid

#%RAML 1.0
title: example api
version: 1.0.0
/events:
  put:
    description: Gets a stream of report results
    responses:
      203: # Invalid status code
        body:
          application/json:
            type: string

Applies to Operation

Constraint

Type: Declarative Validation

Reviews

TypeRuleset
OrganizationMuleSoft
Published by
MuleSoft Organization
Published onDec 11, 2023
Asset overview

Asset versions for 1.6.x

Asset versions
VersionActions
1.6.1
1.6.0

Tags