aboutsummaryrefslogtreecommitdiff
path: root/sx-request.el
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Documentation -- part threeSean Allred2014-11-181-1/+3
| | | | | | | | | | | | Source code is documented to the best of my knowledge and understanding.
| * | Documentation -- part oneSean Allred2014-11-171-20/+60
| | | | | | | | | | | | Pushing this change to continue work elsewhere.
* | | Properly return a nil entry when falling backJonathan Leech-Pepin2014-11-201-1/+1
| | | | | | | | | | | | | | | sx-request-make returns a nested list (or vector of lists). Return `'(())` to ensure it is an acceptable response.
* | | sx-method-call rewritten and associated improvements in sx-request.Jonathan Leech-Pepin2014-11-201-41/+24
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now requires `'sx-auth` to account for authentication. (sx-method-call) is now defined using `cl-defun` and uses keys rather than positional arguments. Authentication logic is performed in `sx-method-call` to ensure commands are only passed on once they are needed. When access token is available: - Filters will be used as provided - Methods will be called When access token is unavailable: - Filters will downgrade to only request object that do not require auth. - Methods will instead use `sx-request-fallback` and return nil. If auth is not specified but is required, `sx-method-call` will throw an error. If auth is specified as `'warn`, `user-error` will be called. (sx-request--build-keyword-arguments) has been simplified. It will always pass an available access_token (api indicates doing so will use a user/key quota rather than simply key quota). (sx-request-make) now performs url retrieval directly. Query construction is all performed by `sx-method-call`.
* | Change from `add-to-list` to `push` to avoid a strange `(void-variableJonathan Leech-Pepin2014-11-171-2/+3
| | | | | | | | | | | | alist)` error. Moved `api-key` to let binding rather than directly in if statement.
* | Adjust request keyword creation to verify if AUTH is needed.Jonathan Leech-Pepin2014-11-171-16/+32
| | | | | | | | | | If `need-auth` is `'warn`, break with `user-error` to advise the user to authenticate. Otherwise the query will result in an `Error 401`.
* | Fix incorrect call to `call` rather than `request-url`Jonathan Leech-Pepin2014-11-171-1/+1
| |
* | Updated `sx-request-make` to use a consistent format for both `POST` and ↵Jonathan Leech-Pepin2014-11-141-20/+24
|/ | | | | | | | | | | | | | | | | `GET` methods. (sx-request-make): Added optional arguments for using "POST" and AUTH when performing requests (sx-request--build-keyword-arguments): Add option of using AUTH and including in query when required. (sx-request-build): Removed (sx-request--request): New function to perform query with all variables let bound. sx-auth.el: Updated `sx-auth-root` to be full auth URL rather than lack method. (sx-auth-authenticate): Remove dependency on `sx-request-build` and perform construction inline.
* Set `sx-request-api-root` to use `https` instead of `http`.Jonathan Leech-Pepin2014-11-141-1/+1
| | | | This will prevent loss of authentication token when using authentication.
* Clean content at the request levelSean Allred2014-11-141-1/+1
|
* Remove spurious lineSean Allred2014-11-121-1/+0
|
* Update code to new assoc-letArtur Malabarba2014-11-121-4/+5
|
* Simplify logical structureSean Allred2014-11-111-1/+1
|
* Include encoding functionsSean Allred2014-11-101-0/+1
|
* Proper GZIP testingSean Allred2014-11-101-17/+11
| | | | | | | Test for a GZIP'd using magic bytes. See the appropriate answer on Emacs.SE (1) for details. (1): http://emacs.stackexchange.com/a/2978
* Merge branch 'master' into initializationSean Allred2014-11-081-1/+0
|\ | | | | | | | | Conflicts: sx-request.el
| * Consolidate keywords, update emailsSean Allred2014-11-081-2/+1
| |
* | Use macroSean Allred2014-11-081-12/+10
| |
* | Abstract out method callsSean Allred2014-11-081-67/+31
| | | | | | | | | | | | | | | | | | | | | | Keeping method calls within `sx-request.el' was causing circular requirements. This commit sorts through all of the requirements for each of the files and ensures that this does not happen. Much of the content removed was for `sx-request-default-keyword-arguments-alist' and related items. It was unused, so it was pruned. If it is deemed necessary in the future, it should be included in `sx-method.el'.
* | Implement front-end with back-endSean Allred2014-11-081-64/+7
| |
* | Use the key for every request; no exceptionsSean Allred2014-11-081-1/+4
| |
* | Add internal request functionSean Allred2014-11-081-0/+52
| |
* | Re-work filtering and cachingSean Allred2014-11-081-2/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | * sx-auth.el - Use new symbolic cache access * sx-cache.el - Implement symbolic cache access * sx-filter.el - Use symbolic cache access - Compile and save filters on-demand (more work to be done to this end) * sx-question.el - Symbolic filters * sx-request.el - Protection against infinitely recursing when compiling a filter This will be re-worked into requests (a front-end function) and 'raw' requests (a back-end function). The front-end will add convenience to the back-end. * test/tests.el Remove outdated tests
* Refactor to use `sx-` prefixSean Allred2014-11-071-0/+194
A file stackexchange.el should be added for user-facing functions.