Add websave() function

The websave() function in Matlab is to save a RESTFul request body to a local file.
So its code may be like:
>> tmp = webread(<website>);
>> fp = fopen(<file_name>, ‘w’);
>> fprintf(fp, tmp);
>> fclose(fp);

But I have no longer purchased Matlab license for a long time, so I’m not sure that whether Matlab has any conditions to throw errors in websave().
And this function also need <file_name>, which should be found in RESTFul request head. For parsing the head infomation, Octave may need to add a new RESTFul request class to save and use such information.
I want to ask maintainers that how websave() function should be developed?

If you are interested in developing this function, you can take a look at how “webread” and “webwrite” have been implemented as part of a GSoC project in 2018.

The m-file code linked above makes internally use of libcurl, thus requires some C programming experience.

I wrote this function and here is the patch. Could you help reviewing the code?
websave.patch (4.6 KB)
I will write a GSoC-style introduction later.