Skip to main content

no-request-payload-with-get-method

Overview

This rule belongs to the postman-validation ruleset and states that:

A request that uses method GET must not define a payload. This means that for Postman Collections v1.0, sending the payload should either be disabled using the request's dataDisabled flag or properties data, rawModeData and dataMode must not be set. Similarly, for Postman Collections v2.0 or above, property body in the request should either not be set or it should be disabled using the body object level disabled flag. This is because such methods do not expect a body and, therefore, all related information will be ignored automatically during import/transformations in APIMatic.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageRequest uses method GET but has defined a payload.
CodePOSTMAN_V356
TypeValidation
Rule SystemSemantic
Broad CategoryRequests
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagspostman api semantic validation payload data body get method request

Suggested Fixes

  • If you are using Postman Collections v1.0, remove property definitions of data, rawModeData, dataMode from the request definition.
  • If you are using Postman Collections v1.0 and wish to retain the payload definition, you can also simply set property dataDisabled to true in the request definition.
  • If you are using Postman Collections v2.0 and above, remove definition of property body from the request definition.
  • If you are using Postman Collections v2.0 and above and wish to retain the body definition, then simply set disabled flag to true in the body definition.
  • In the Postman application, open the Body section of your request and select none or an equivalent option from the list. Save and export your file again.

For More Information