MCPcopy
hub / github.com/httpie/cli / _ensure_one_data_source

Method _ensure_one_data_source

httpie/cli/argparser.py:399–407  ·  view source on GitHub ↗

There can only be one source of input request data.

(self, *other_sources)

Source from the content-addressed store, hash-verified

397 self.args.data = data.encode()
398
399 def _ensure_one_data_source(self, *other_sources):
400 """There can only be one source of input request data.
401
402 """
403 if any(other_sources):
404 self.error('Request body (from stdin, --raw or a file) and request '
405 'data (key=value) cannot be mixed. Pass '
406 '--ignore-stdin to let key/value take priority. '
407 'See https://httpie.io/docs#scripting for details.')
408
409 def _guess_method(self):
410 """Set `args.method` if not specified to either POST or GET

Callers 2

_body_from_fileMethod · 0.95
_body_from_inputMethod · 0.95

Calls 1

errorMethod · 0.95

Tested by

no test coverage detected