{"id":15546925,"url":"https://github.com/threeletters/minirequest","last_synced_at":"2026-05-10T05:17:17.186Z","repository":{"id":57298043,"uuid":"67901014","full_name":"ThreeLetters/MiniRequest","owner":"ThreeLetters","description":"A http/https request tool all in one file","archived":false,"fork":false,"pushed_at":"2017-06-15T02:20:20.000Z","size":55,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-30T10:17:53.114Z","etag":null,"topics":["browser","http","http-client","https","nodejs","npm-package","request","simple"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThreeLetters.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}},"created_at":"2016-09-11T00:14:37.000Z","updated_at":"2017-06-15T01:42:55.000Z","dependencies_parsed_at":"2022-09-06T03:30:42.308Z","dependency_job_id":null,"html_url":"https://github.com/ThreeLetters/MiniRequest","commit_stats":null,"previous_names":["ajs-development/minirequest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ThreeLetters/MiniRequest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FMiniRequest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FMiniRequest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FMiniRequest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FMiniRequest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThreeLetters","download_url":"https://codeload.github.com/ThreeLetters/MiniRequest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FMiniRequest/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266596730,"owners_count":23953892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["browser","http","http-client","https","nodejs","npm-package","request","simple"],"created_at":"2024-10-02T13:05:22.889Z","updated_at":"2026-05-10T05:17:17.152Z","avatar_url":"https://github.com/ThreeLetters.png","language":"JavaScript","funding_links":["https://paypal.me/andrews54757"],"categories":[],"sub_categories":[],"readme":"[![NPM](https://img.shields.io/badge/Module-Npm-blue.svg)](https://www.npmjs.com/package/minirequest)\n[![Donate](https://img.shields.io/badge/Donate-Paypal-brightgreen.svg)](https://paypal.me/andrews54757)\n# MiniRequest\nWhy use an entire npm library such as Request to just do a small task? so use MiniRequest! It is all in one file (index.js) and if you dont want to use npm, use minified.js in your own projects! Dont want to have it in a separate file? Replace ``module.exports`` to whatever variable you want and put it in your code and you can use it by just calling that function! Works just like the request module\n\n## Documentation\n#### Usage\n\ndo\n\n\n``npm install minirequest``\n\n\nthen do in code: \n\n\n```js\nvar request = require('minirequest')\n```\n\n\nor put minified.js into a file called request.js in your project and do\n\n\n```js\nvar request = require('./request.js')\n```\n\n\nor do this in your code\n\n\n```js\nvar http=require(\"http\"),https=require(\"https\"),querystring=require(\"querystring\");\nvar request=function(f,b,c,d){var e=!1,h=!1;if(c){e=querystring.stringify(b);var g=c;h=d}else g=b,h=c;d=!1;b=\"/\";var m=\"\";c=\"\";var a=f.split(\"://\");d=\"https\"==a[0]?!0:!1;a=a[1]?a.slice(1).join(\"://\"):a[0];a=a.split(\"/\");var k=a[0].split(\":\");f=k[0];k[1]\u0026\u0026(c=parseInt(k[1]));a[1]\u0026\u0026(b+=a.slice(1).join(\"/\"));d=d?https:http;h\u0026\u0026(b+=\"?\"+Date.now());try{var n=e?{host:f,path:b,port:c,method:\"POST\",headers:{\"Content-Type\":\"application/x-www-form-urlencoded\",\"Content-Length\":Buffer.byteLength(e)}}:{host:f,\npath:b,port:c},l=d.request(n,function(a){a.setEncoding(\"utf8\");a.on(\"data\",function(a){m+=a});a.on(\"end\",function(){g(!1,a,m)})});l.on(\"error\",function(a){g(a,null,null)});e\u0026\u0026l.write(e);l.end()}catch(p){g(p,null,null)}};\n```\n\n#### Browser\nThere is a working browser version in browser/MiniRequest.js\n\n##### CDN\n\u003e https://cdn.rawgit.com/ThreeLetters/MiniRequest/master/browser/MiniRequestMinified.js\n\nScript tag:\n\n\u003e \u003cscript src=\"https://cdn.rawgit.com/ThreeLetters/MiniRequest/master/browser/MiniRequestMinified.js\"\u003e\u003c/script\u003e\n#### Using the function\n```js\n// GET\n\nrequest('www.google.com',function(error,response,content) {\nif (!error \u0026\u0026 response.statusCode = 200) {\nconsole.log(content)\n}\n});\n\n// POST\nvar somethingtosend = {\nblah: \"blah\"\n}\n\nrequest('www.google.com',somethingtosend,function(error,response,content) {\nif (!error \u0026\u0026 response.statusCode = 200) {\nconsole.log(content)\n}\n});\n\n// Cache Busting\n\nrequest(url,callback,true) // GET\nrequest(url,data,callback,true) // POST\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreeletters%2Fminirequest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreeletters%2Fminirequest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreeletters%2Fminirequest/lists"}