mirkoperillo / resting

A visual HTTP client browser extension
https://resting.owlcode.eu/
GNU General Public License v3.0
27 stars 12 forks source link

Headers completion suggestions #52

Closed albertotn closed 1 year ago

albertotn commented 6 years ago

When I want to create a rest request, is quite often the same thing: define the method, url, authorization and content-type. It's possible to add a quick (aka suggestion list) for contentype in headers? For both name and values, like in postman:

immagine

mirkoperillo commented 6 years ago

This could be a good helper to improve experience

nikhilraojl commented 1 year ago

Hi @mirkoperillo, I was looking this issue. Basically I had two approaches

Any help on this would be appreciated 🙇

mirkoperillo commented 1 year ago

@nikhilraojl I have to think a little bit about it.

Meanwhile some details.

This feature should be added to the entry-list component.

entry-list component is used in many place in Resting, everywhere a list of values is needed. So it is used in:

The suggestion feature as presented here is interesting only for the Headers tab, so this feature should be optional (possible to enable/disable). Something like it has been already implemented for the file field

https://github.com/mirkoperillo/resting/blob/9d2fecef281a48c0db1b7fd999b2916a4dd41428/src/js/app/components/request-body/requestBody_view.html#L32

https://github.com/mirkoperillo/resting/blob/9d2fecef281a48c0db1b7fd999b2916a4dd41428/src/js/app/components/entry-list/entryItemVm.js#L22

This is a very useful feature and it is good to implement as soon as possible, but we should find an easy way to do it without too many effort, because the long-term idea is to move everything from knockoutjs to vuejs (as we have already started doing).

mirkoperillo commented 1 year ago

First one was using datalist tag. The problem is that there is no Knockoutjs binding for datalist tag. This is not allowing me to use foreach binding for list all headers from an array (I haven't used much KO and I may be wrong here, please correct me).

@nikhilraojl I think datalist is the most easy solution to implement. You can do something like this (an example using solar system planets)

in the html (entry-list/entryList_view.html)

<input type="text" list="planets" data-bind="value: planet"/>

<datalist id="planets">
<!-- ko foreach: solarPlanets -->
<option><span data-bind="text: $data"></span></option>
<!-- /ko -->
</datalist>

in the js file (entry-list/entryLisVm.js)

function AppViewModel {
    this.planet = ko.observable('')
    this.solarPlanets = ko.observableArray(["Plutone", "Giove", "Terra"])
}

If you are interested into work on this, open a draft pull request with work-in-progress code and I will be happy to help and advise you about

nikhilraojl commented 1 year ago

@mirkoperillo Please take a look at #191 when possible, thanks

mirkoperillo commented 1 year ago

@nikhilraojl I am going to give it a look in the next days. Thank you for your help

nikhilraojl commented 1 year ago

@mirkoperillo you mentioned in this issue that the idea is to move to vuejs. I am interested in helping with this. Please let me know if there is anything I can help with any current issues to focus before transitioning or any blockers

mirkoperillo commented 1 year ago

@nikhilraojl yes this is absolutely the roadmap. The idea is an incremental and total move to vuejs in the next period. I'm very happy to know you are interesting in helping with the project. Watch the project because in the next period I'm going to open some issues about these activities.