http_requests 1.0.0 http_requests: ^1.0.0 copied to clipboard
HTTP Requests Package Inspired By Python Requests Module Which Is Used For To Make Http Request And Get Response. You Can Use It In Rest Api
import 'package:http_requests/http_requests.dart';
void main() async {
// Get Method
Response r = await HttpRequests.get("https://secanonm.in");
print(r);
// Post Method With Headers And Data
Map header = {
'Host': 'www.secanonm.in',
'User-Agent':
'Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0',
'Accept':
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Accept-Encoding': 'gzip, deflate, br',
'Connection': 'keep-alive'
};
Map query = {"name": "kiyan"};
Response req = await HttpRequests.post("https://secanonm.in",
headers: header, data: query);
print(req.status);
}