rubycdp / ferrum

Headless Chrome Ruby API
https://ferrum.rubycdp.com
MIT License
1.71k stars 123 forks source link

Add postData getter for network request #243

Closed rmarot closed 2 years ago

rmarot commented 2 years ago

This PR is to add a method on the Ferrum::Network::Request object in order to allow the optional POST body to be retrieved (or nil when it does not exist).

It looks like unit tests are skipped for this object, but let me know if this requires additional changes in order to be merged.

ttilberg commented 2 years ago

My small feedback is that this method should be called #body. That would be consistent with HTTP in general, other libraries and be more expected. It’s even in your description of the change ;)

edit: or perhaps, at worst, aliasing it?

rmarot commented 2 years ago

My small feedback is that this method should be called #body. That would be consistent with HTTP in general, other libraries and be more expected. It’s even in your description of the change ;)

edit: or perhaps, at worst, aliasing it?

Yes, honestly I wasn't sure about #post_data, but it looks indeed more relevant to me to use #body.

ttilberg commented 2 years ago

Since the CDP method is postData they both have merit. Curious what the bosses will say.

route commented 2 years ago

Let's alias it as Tim suggested, and I'll merge it

route commented 2 years ago

Thank you

rmarot commented 2 years ago

Thank you

Thanks !