Code Monkey home page Code Monkey logo

Comments (6)

parroty avatar parroty commented on July 4, 2024

Thank you for taking time on this. I'm having difficulty to take time for a while, but will be looking into this one.

from exvcr.

edgurgel avatar edgurgel commented on July 4, 2024

It's not a bad idea to have an option to store JSON or erlang terms (binary file in this case?).

from exvcr.

nicoolas25 avatar nicoolas25 commented on July 4, 2024

I stored it with :io.format('~w.', term) and parsed it back with the :erl_{parser,scanner,..}. It may exist a better technique out there...

from exvcr.

parroty avatar parroty commented on July 4, 2024

Having serializer option sounds reasonable, but I'm wondering that whether it can be resolved by adding option (retain original char-list type) or additional meta information in the json file (store type information). Also, it seems the Ruby's VCR is taking custom serializer approach in addition to native YAML/JSON support. Please let me play around a little more.

from exvcr.

nicoolas25 avatar nicoolas25 commented on July 4, 2024

With the JSON serializer I also noticed that when there is the same HTTP header multiple times like set-cookie there is some loss too. Only one header is kept.

from exvcr.

niklas avatar niklas commented on July 4, 2024

I stumbled upon this issue when vcr-ing the fetch of an image (JPEG) using HTTPoison. In the first run, everything works as expected, but on the second run (with data deserialized from JSON), the body: data I get back is roughly twice the size and (after File.write!) not a valid JPEG anymore.

from exvcr.

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.