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.

Parameter for DELETE request is not passed

See original GitHub issue

Hi,

I try to perform the following test for DELETE method

@Test
public void shouldDeleteAccount() {
  given()
    .parameter("number", "1")
    .when().delete("/account")
    .then().body("message", equalTo("account with number 1 deleted")).statusCode(200);
}

but it seems parameter named number is not passed to this request. Similar test for POST method works fine. Can you confirm that or show me correct usage of the library?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
pwittchencommented, Sep 18, 2018

It makes sense. Actually, design of my API was wrong, where DELETE should take just one parameter and it could be in the path instead of form param. I already updated my API and test to use path param.

0reactions
pwittchencommented, Sep 18, 2018

Good to know that. I don’t have much experience with this library, so I wasn’t aware of implementations of these methods under the hood.

Read more comments on GitHub >

github_iconTop Results From Across the Web

REST, HTTP DELETE and parameters - Stack Overflow
Consider a REST client which assumes a standard REST service - how will the service let the client know that it needs to...
Read more >
DELETE - HTTP - MDN Web Docs
The HTTP DELETE request method deletes the specified resource.
Read more >
REST - Should you use a body for your HTTP DELETE ...
I recently had to make a delete endpoint and I was wondering if I should use a URL path parameter or provide a...
Read more >
PUT, POST, and DELETE methods - IBM
The DELETE method requires the unique ID of the resource. Concurrent updates of resources. Processing can be controlled so that a resource is...
Read more >
What is HTTP DELETE Request Method? - ReqBin
A successful response MUST be 200 (OK) if the server response includes a message body, 202 (Accepted) if the DELETE action has not...
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