[opensuse] Editing Text Retrieved via HTTP GET & Saved via HTTP POST?
Hi, I have a Web service with a REST interface that allows retrieval and update of some text held in a persistent storage system (DBMS-based). I discovered (somehow) that Vim will, when invoked on an HTTP URL, retrieve the bytes from that URL and load them into the editing buffer. However, it has no way of saving them back using HTTP POST. Some digging led me to the "netrw" Vim extension script that provides the sort of remote file read/write I'd like except that HTTP is not supported. So, my question is: Does anyone know of an editor that can do this? Apart from the URL the only parameter required to POST the new data back to the server is the name of the HTTP parameter name with which to associate the uploaded data. That value is under my control, if it would be helpful to pick some specific value instead of the one I chose. In the interim, I wrote a simple script that uses CURL to send the file and bound it to a key combination in ~/.vimrc, but I'm wondering if there's something a little more direct available. While I personally need a solution that is _other_ than Emacs, I also have a user for this Web service who _is_ an Emacs user, so I'd be interested in solutions for Emacs, too. Thanks. Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Am Samstag, 1. März 2008 19:18 schrieb Randall R Schulz:
Hi,
I have a Web service with a REST interface that allows retrieval and update of some text held in a persistent storage system (DBMS-based).
I discovered (somehow) that Vim will, when invoked on an HTTP URL, retrieve the bytes from that URL and load them into the editing buffer.
However, it has no way of saving them back using HTTP POST. Some digging led me to the "netrw" Vim extension script that provides the sort of remote file read/write I'd like except that HTTP is not supported.
So, my question is: Does anyone know of an editor that can do this? Apart from the URL the only parameter required to POST the new data back to the server is the name of the HTTP parameter name with which to associate the uploaded data. That value is under my control, if it would be helpful to pick some specific value instead of the one I chose.
In the interim, I wrote a simple script that uses CURL to send the file and bound it to a key combination in ~/.vimrc, but I'm wondering if there's something a little more direct available.
While I personally need a solution that is _other_ than Emacs, I also have a user for this Web service who _is_ an Emacs user, so I'd be interested in solutions for Emacs, too.
Thanks.
Randall Schulz
With Emacs the solution to edit remote files is called `tramp'. However, it uses ftp to transfer date AFAIU. Anyway, for me it works fine. Andreas Röhler GNU Emacs 23.0.50.2 (i686-pc-linux-gnu, GTK+ Version 2.10.6) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 01 March 2008 11:06, Andreas Röhler wrote:
...
With Emacs the solution to edit remote files is called `tramp'. However, it uses ftp to transfer date AFAIU.
HTTP is mandatory and the only option for my purposes.
Anyway, for me it works fine.
Andreas Röhler
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 01/03/2008, Randall R Schulz
So, my question is: Does anyone know of an editor that can do this? Apart from the URL the only parameter required to POST the new data back to the server is the name of the HTTP parameter name with which to associate the uploaded data. That value is under my control, if it would be helpful to pick some specific value instead of the one I chose.
I believe any KDE app will do this, so kwrite/kate. You can also wrap vim with kioexec, so "kioexec vim http://example.com/somefile" Then kioexec will upload changes after you close vim, it doesn't work without X though. -- Benjamin Weber -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 01 March 2008 12:10, Benji Weber wrote:
On 01/03/2008, Randall R Schulz
wrote: So, my question is: Does anyone know of an editor that can do this? Apart from the URL the only parameter required to POST the new data back to the server is the name of the HTTP parameter name with which to associate the uploaded data. That value is under my control, if it would be helpful to pick some specific value instead of the one I chose.
I believe any KDE app will do this, so kwrite/kate.
Really? Let me see... I tried Kate. Reading works, not too surprisingly, but it's not able to POST the edited contents back to the URL from which it originally retrieved them.
You can also wrap vim with kioexec, so "kioexec vim http://example.com/somefile" Then kioexec will upload changes after you close vim, it doesn't work without X though.
X is good. I always have KDE running.
-- Benjamin Weber
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 01/03/2008, Randall R Schulz
On Saturday 01 March 2008 12:10, Benji Weber wrote:
On 01/03/2008, Randall R Schulz
wrote: So, my question is: Does anyone know of an editor that can do this? Apart from the URL the only parameter required to POST the new data back to the server is the name of the HTTP parameter name with which to associate the uploaded data. That value is under my control, if it would be helpful to pick some specific value instead of the one I chose.
I believe any KDE app will do this, so kwrite/kate.
Really? Let me see...
I tried Kate. Reading works, not too surprisingly, but it's not able to POST the edited contents back to the URL from which it originally retrieved them.
Are you sure? Seems to work for other people http://news.opensuse.org/2007/07/18/nice-trick-to-use-apiopensuseorg-native-... for example. -- Benjamin Weber -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 01 March 2008 12:30, Benji Weber wrote:
On 01/03/2008, Randall R Schulz
wrote: On Saturday 01 March 2008 12:10, Benji Weber wrote:
On 01/03/2008, Randall R Schulz
wrote: So, my question is: Does anyone know of an editor that can do this? Apart from the URL the only parameter required to POST the new data back to the server is the name of the HTTP parameter name with which to associate the uploaded data. That value is under my control, if it would be helpful to pick some specific value instead of the one I chose.
I believe any KDE app will do this, so kwrite/kate.
Really? Let me see...
I tried Kate. Reading works, not too surprisingly, but it's not able to POST the edited contents back to the URL from which it originally retrieved them.
Are you sure? Seems to work for other people http://news.opensuse.org/2007/07/18/nice-trick-to-use-apiopensuseorg- native-with-kde-apps/ for example.
OK. That page held the clue I needed. These mechanisms (kioexec, kio_http, etc.) use PUT, not POST. So I implemented a PUT handler in my server (in addition to the POST handler I had) and—voila!—it works. This is just what I was looking for. Thanks! Now I don't get why the Vim "netrw" doesn't handle HTTP via PUT. It seems simple enough (simpler than many of the schemes it does support such as ftp, scp, rcp, etc.). By the way, I tried running Vim under "kioexec" but the problem with that is that Vim does not get a direct connection to the TTY: % kioexec vi http://host/path Vim: Warning: Input is not from a terminal After that, it's all messed up and Vim needs to be killed. Do you know how to solve this problem? Again, thanks for the tip.
-- Benjamin Weber
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
Andreas Röhler
-
Benji Weber
-
Randall R Schulz