Skip to content

Instantly share code, notes, and snippets.

@abc873693
Last active August 10, 2019 16:36
Show Gist options
  • Save abc873693/6976cdb981c5ec505dafd6b0579904bf to your computer and use it in GitHub Desktop.
Save abc873693/6976cdb981c5ec505dafd6b0579904bf to your computer and use it in GitHub Desktop.
import 'dart:convert';
import 'dart:io';
void main() async {
final rocId = '你的身分證';
final client = HttpClient();
List<int> bodyBytes = utf8.encode("uid=$rocId"); // utf8 encode
final request = await client.postUrl(
Uri.parse('https://webap.nkust.edu.tw/nkust/system/getuid_1.jsp'),
);
request.headers.add('Connection', 'keep-alive');
request.headers.add('Content-Length', "uid=$rocId".length.toString());
request.headers.add('Content-Type', 'application/x-www-form-urlencoded');
request.add(bodyBytes);
final response = await request.close();
var text = await utf8.decoder.bind(response).first;
print(text);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment