{"id":25538785,"url":"https://github.com/wnikk/httpui","last_synced_at":"2026-04-14T04:01:11.308Z","repository":{"id":278285478,"uuid":"935121015","full_name":"wnikk/httpui","owner":"wnikk","description":"HttpUi is a versatile JavaScript library for simplifying AJAX requests and UI interactions, supporting both jQuery and Fetch API.","archived":false,"fork":false,"pushed_at":"2025-09-18T11:53:33.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-18T13:45:04.420Z","etag":null,"topics":["ajax","bootstrap","fetch-api","frontend","jquery-plugin","promises","react","ui","vue3"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wnikk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-18T23:57:59.000Z","updated_at":"2025-09-18T11:53:36.000Z","dependencies_parsed_at":"2025-09-18T13:23:57.836Z","dependency_job_id":"8c6a6ad5-76f4-43dc-9a03-94d802918471","html_url":"https://github.com/wnikk/httpui","commit_stats":null,"previous_names":["wnikk/httpui"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wnikk/httpui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnikk%2Fhttpui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnikk%2Fhttpui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnikk%2Fhttpui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnikk%2Fhttpui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wnikk","download_url":"https://codeload.github.com/wnikk/httpui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnikk%2Fhttpui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31781292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajax","bootstrap","fetch-api","frontend","jquery-plugin","promises","react","ui","vue3"],"created_at":"2025-02-20T05:24:04.046Z","updated_at":"2026-04-14T04:01:11.270Z","avatar_url":"https://github.com/wnikk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## HttpUi.js Class\n\nThe `HttpUi` class is a versatile JavaScript library designed to simplify AJAX requests and UI interactions. It supports both jQuery and Fetch API for making HTTP requests, and it can be used as a jQuery plugin, a global function, or a module in modern JavaScript frameworks like Vue or React.\n\n### Features\n\n- **Singleton Pattern**: Ensures a single instance of the `HttpUi` class is used throughout the application.\n- **AJAX Requests**: Supports GET, POST, PUT, DELETE, PATCH, HEAD, and OPTIONS methods.\n- **jQuery and Fetch API**: Automatically uses jQuery for AJAX requests if available, otherwise falls back to Fetch API.\n- **UI Interactions**: Provides methods to display loaders, alerts, and error messages.\n- **Form Serialization**: Serializes form data for easy submission.\n- **Error Handling**: Displays detailed error messages and handles common HTTP errors gracefully.\n\n### Usage\n\n#### As a jQuery Plugin\n\n```javascript\n$(document).ready(function() {\n    $('.form-basic').on('submit', function(e) {\n        e.preventDefault();\n        $(this).httpUi({\n            method: 'PUT',\n            url: '/your-url',\n            onSuccess: (data, response) =\u003e console.log('Success:', data),\n            onError: (error, response) =\u003e console.error('Error:', error)\n        });\n    });\n});\n```\n\n#### As a Global Function\n\n```javascript\ndocument.querySelector('.form-basic').addEventListener('submit', async function(e) {\n    e.preventDefault();\n    try {\n        const response = await httpUi({\n            method: 'PUT',\n            url: '/your-url',\n            context: this\n        });\n        console.log('Success:', response.data);\n    } catch (error) {\n        console.error('Error:', error);\n    }\n});\n```\n\n#### As a Module in Vue or React\n\n```javascript\nimport httpUi from 'path/to/centUi';\n\nasync function submitForm(e) {\n    e.preventDefault();\n    httpUi({\n        method: 'PUT',\n        url: '/your-url',\n        context: e.target,\n    }).then(\n        response =\u003e console.log('Success:', response.data)\n    ).catch(\n        error =\u003e console.error('Error:', error)\n    );\n}\ndocument.querySelector('.form-basic').addEventListener('submit', submitForm);\n```\n\n### Methods\n\n- `request(params)`: Sends an AJAX request with the specified parameters.\n- `get(url, params)`: Sends a GET request.\n- `post(url, data, params)`: Sends a POST request.\n- `put(url, data, params)`: Sends a PUT request.\n- `delete(url, params)`: Sends a DELETE request.\n- `patch(url, data, params)`: Sends a PATCH request.\n- `head(url, params)`: Sends a HEAD request.\n- `options(url, params)`: Sends an OPTIONS request.\n\n### Parameters\n\n- `url`: The URL to send the request to.\n- `method`: The HTTP method to use (default is 'GET').\n- `data`: The data to send with the request.\n- `onSuccess(response)`: Callback function to handle a successful response.\n- `onError(error)`: Callback function to handle an error response.\n- `context`: The context in which to execute the callbacks.\n- `contextLock`: The element to display the loader on.\n- `contextStatus`: The element to display status messages on.\n\n### Installation\n\nTo install the `HttpUi` library, include the `httpUi.js` file in your project and use it as described above.\n\n## Contributing\n\nPlease report any issue you find in the issues page. Pull requests are more than welcome.\n\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwnikk%2Fhttpui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwnikk%2Fhttpui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwnikk%2Fhttpui/lists"}