NSLS-II / olog

Python client to the Olog
BSD 3-Clause "New" or "Revised" License
2 stars 4 forks source link

Add requests Client support #18

Open ke-zhang-rd opened 4 years ago

ke-zhang-rd commented 4 years ago

based on discuss https://github.com/NSLS-II/pyolog2/issues/11#issuecomment-635513065

danielballan commented 4 years ago

It looks like there is consensus that this is worthwhile, especially given that it wouldn't be difficult.

I suggest we hold off just a little longer to be sure that the original Client is stable and designed the way we like it. Once we have two similar-but-different-enough-to-require-two-classes Clients, every change will need to be applied in two places.

ke-zhang-rd commented 4 years ago

I wrote some code already in https://github.com/ke-zhang-rd/pyolog2/blob/requests-client/rolog.py but would like to pause as @danielballan mentioned waiting to stable.

I was trying to use vcr record of httpx package in cassettes directory to test requests. Natively thinking since both are http response, it could just work with only diff in test_olog.py below:

- from olog import Client
+ from rolog import Client

However, I found requests and httpx doesn't create identical json-like body by vcrpy. In conclusion, we need a new directory maybe requests_cassettes for requests vcr record

ke-zhang-rd commented 4 years ago

This need to address #19