Labs/Bespin/ServerAPI: Difference between revisions

Jump to navigation Jump to search
→‎Files: removing GET as option for /file/close because of the edit loss
(→‎Files: removing GET as option for /file/close because of the edit loss)
Line 27: Line 27:
* PUT /file/[path]?lastEdit=[n] to save a file, with the file contents as the PUT body. subdirectories will be created as needed. If the lastEdit parameter is excluded, the request will only succeed if the file is *not* open for editing. Otherwise, the lastEdit parameter must include the number of the last edit received by the client at the time the save was requested.
* PUT /file/[path]?lastEdit=[n] to save a file, with the file contents as the PUT body. subdirectories will be created as needed. If the lastEdit parameter is excluded, the request will only succeed if the file is *not* open for editing. Otherwise, the lastEdit parameter must include the number of the last edit received by the client at the time the save was requested.
* DELETE /file/[path] to delete a file. file must not be open by anyone.  
* DELETE /file/[path] to delete a file. file must not be open by anyone.  
* POST (or GET) /file/close/[path] to mark the file closed. The server will discard your edit history.  
* POST /file/close/[path] to mark the file closed. The server will discard your edit history.  
* GET /file/listopen/ to list open files for the current user. a JSON dictionary of <tt>{ project: { filename: mode } }</tt> will be returned. For example, if subdir1/subdir2/test.py is open read/write, openfiles will return <tt>{ "subdir1": { "somedir2/test.py": "rw" } }</tt>
* GET /file/listopen/ to list open files for the current user. a JSON dictionary of <tt>{ project: { filename: mode } }</tt> will be returned. For example, if subdir1/subdir2/test.py is open read/write, openfiles will return <tt>{ "subdir1": { "somedir2/test.py": "rw" } }</tt>


canmove, Confirmed users, Bureaucrats and Sysops emeriti
1,093

edits

Navigation menu