Giter VIP home page Giter VIP logo

Comments (6)

kevin1024 avatar kevin1024 commented on May 20, 2024

I would like to add support for custom request matchers. This would allow you to register a function that takes two Request objects, and returns True if they match, False if they don't. I think this would solve this issue.

I have an API already for registering custom serializers, I would like to use the same registration mechanism.

from vcrpy.

kevin1024 avatar kevin1024 commented on May 20, 2024

Actually, providing a mode where it just matches on request path + method, and ignoring body contents for matching purposes, might solve this problem as well?

from vcrpy.

fatuhoku avatar fatuhoku commented on May 20, 2024

Regarding your first message:

Aye, that's a great idea: it throws the ball into the user's court. In my case, I would still need to parse the request and strip out the parameters.

About request path + method: yes, this is actually fine. This feels like we're moving towards HTTPretty — VCR. TBH I'd love to see these two projects eventually converge... haha. HTTPretty with recording/playback features would be great (EDIT: ah, well, I just saw this. Always ahead of the game, aren't you!)

So yes; when recording, record everything but when looking up responses just match on request path and method.

How would you implement this?

from vcrpy.

kevin1024 avatar kevin1024 commented on May 20, 2024

Just implemented it, check out the staging branch and let me know if that works for you :)

from vcrpy.

kevin1024 avatar kevin1024 commented on May 20, 2024

I went ahead and released the new request-matching framework, I think this should solve this issue.

from vcrpy.

fatuhoku avatar fatuhoku commented on May 20, 2024

I will give it a shot... that was very quick!

from vcrpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.