curlify icon indicating copy to clipboard operation
curlify copied to clipboard

Handle binary file

Open leNEKO opened this issue 6 years ago • 3 comments

A way to handle binary file without any file size limits

leNEKO avatar Dec 11 '19 22:12 leNEKO

Hi!

First of all, thank you for your contribution!

I have a couple of comments:

  • I think it is better move requirements.txt to requirements_test.txt to make it clear that they are only for tests.
  • Also I suggest that creating temp file must be controlled by a flag passed to to_curl function because writing files are slow and not always needed. For example, when this library is used on remote server to which you don't have a direct access to run curl from its environment but you have access only to its logs collected by another server. So one can't really reproduce request on local machine when file was generated on a remote one.

ofw avatar Dec 14 '19 08:12 ofw

Hello :)

I think it is better move requirements.txt to requirements_test.txt to make it clear that they are only for tests.

Indeed, that's way better :)

Also I suggest that creating temp file must be controlled by a flag passed to to_curl function because writing files are slow and not always needed. For example, when this library is used on remote server to which you don't have a direct access to run curl from its environment but you have access only to its logs collected by another server. So one can't really reproduce request on local machine when file was generated on a remote one.

OK, i give a try using a flag for switching between the tempfile method and an inline one (if possible)

leNEKO avatar Dec 14 '19 09:12 leNEKO

OK, i give a try using a flag for switching between the tempfile method and an inline one (if possible)

Let me know please if you are going to add this flag. When it is added I'll merge this request.

ofw avatar Dec 17 '19 13:12 ofw