this post was submitted on 06 Jul 2023
135 points (100.0% liked)

Programming

17369 readers
517 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
 

I would like to hear if any of you are using different app for API testing than Postman.

I’m not telling that Postman is bad, but maybe there’s all that I should check out. Recently I tried RapidApi and even tho the app is kinda cool I missed few options and went back to Postman for now.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 7 points 1 year ago (2 children)

I use Hurl. Everything is just a text file:

POST https://example.org/api/tests
{
    "id": "4568",
    "evaluate": true
}

HTTP 200
[Asserts]
header "X-Frame-Options" == "SAMEORIGIN"
jsonpath "$.status" == "RUNNING"    # Check the status code
jsonpath "$.tests" count == 25      # Check the number of items
jsonpath "$.id" matches /\d{4}/     # Check the format of the id
[–] snowe 1 points 1 year ago (1 children)
[–] [email protected] 3 points 1 year ago (1 children)

It's very similar to what JetBrains has and you can easily translate between the two (assuming you aren't using assertions or any Hurl-specific features), but not exactly the same syntax.

I tend to go with Hurl because it's self contained and you can do things like throw it in your CI builds.

[–] snowe 1 points 1 year ago

that's really neat... I've wanted to use it in CI but hadn't found a way. I might look into this.

[–] DanHulton 1 points 1 year ago

Came here to write this, so you get my upvote instead.

I don't actually use Hurl, I use Jest (since I'm usually writing in TS) so that I can prep state before and confirm it afterwards and fully ensure that the request did what it was supposed to do, but if you're already just using Postman, you're likely not testing your state, and Hurl is a SIGNIFICANT improvement.

Edit text files in any editor. Run it from the command line. Include it in your CICD with ease. It's an incredible tool and it deseres to be far, far more popular than it is.