question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parametrize (http) method.

See original GitHub issue

I want to make sure that my API rejects certain http methods:

---
marks:
  - parametrize:
      key: http_method
      vals:
        - POST
        - PUT
        - DELETE
        - PATCH

test_name: No writes allowed to user endpoint

stages:
  - name: try  {http_method}
    request:
      url: http://localhost/o/user/
      method: "{http_method}"
      headers:
        content-type: application/json
        authorization: "Bearer xyz1234abcd"
    response:
      status_code: 405

it fails with:

pykwalify.errors.SchemaError: <SchemaError: error code 2: Schema validation failed:
 - Enum '{http_method}' does not exist. Path: '/stages/0/request/method'.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ChristianSauercommented, Jul 13, 2020

I think this feature has enormous potential - a lot of APIs have a lot of combinations (parameter x,y set to A,b , do X,Z also work) and simply listing them would be so helpful.

2reactions
benhowescommented, Feb 7, 2019

Completely agree with you @cleder - it’s not a usecase we’ve got covered very well. I will have a look and see about getting this in to the syntax.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to parameterize the HTTP method when using ...
I'm using HttpClient in .Net core 3.1. Most of my requests follow a similar pattern regardless of the HTTP method used: build URL;...
Read more >
How to Parameterize URL for HTTP Transformation - YouTube
This video explains how to parameterize URL for HTTP Transformation. This is a new feature available in 10.4 onwards where you can ...
Read more >
REST API Design Best Practices for Parameter and Query ...
Generally speaking, parametrization is a kind of request configuration. In a programming language, we can request a return value from a function ......
Read more >
Parameterized URL Method - IBM
The parameterized URL method performs tasks or starts specific components using parameters typed in the Web browser address bar.
Read more >
Defining a new HTTP method: HTTP SEARCH
HTTP SEARCH is a new HTTP method, for safe requests that include a request… ... GET requests can be parameterized by their URL,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found