thank you very much for this very useful library - I've been using it in my own project to capture my application's network traffic and use it to debug.
I've found some enhancements / bug fixes that I would love to be part of your library:
I'm initiating AxiosInstance (using axios.createInstance(...)) - your library currently expects AxiosStatic (which inherits from AxiosInstance). I don't think you are using any of the AxiosStatic specific functions, which is why this is a drop in replacement (simply a typing change)
My instances use the baseURL configuration - this is currently not tracked by this library. From the Axios Docs: "baseURL will be prepended to url unless url is absolute", which is why I've added a getURL function that determines if url is absolute or not and tracks this correctly
Query parameters, that are configured through config.params are currently not applied to the URL (as expected by the standard) - getURL handles this as well
I'm using an axios instance across multiple sessions and want to be able to reset the har file between those sessions. For this use case, clearing the object is sufficient - since it's private I can not easily access it. I've added a public function to resetHar()
I'm optionally adding the possibility to configure the har file 'creator'
Finally I've added tests for the query parameters as well as base URL behaviour. I hope you'll accept this PR and can merge it into production soon :) LMK if you have questions!
Hey @BeataKr ,
thank you very much for this very useful library - I've been using it in my own project to capture my application's network traffic and use it to debug.
I've found some enhancements / bug fixes that I would love to be part of your library:
AxiosInstance
(usingaxios.createInstance(...)
) - your library currently expectsAxiosStatic
(which inherits fromAxiosInstance
). I don't think you are using any of theAxiosStatic
specific functions, which is why this is a drop in replacement (simply a typing change)baseURL
configuration - this is currently not tracked by this library. From the Axios Docs: "baseURL
will be prepended tourl
unlessurl
is absolute", which is why I've added agetURL
function that determines ifurl
is absolute or not and tracks this correctlyconfig.params
are currently not applied to the URL (as expected by the standard) -getURL
handles this as wellresetHar()
Finally I've added tests for the query parameters as well as base URL behaviour. I hope you'll accept this PR and can merge it into production soon :) LMK if you have questions!