Last active
August 10, 2019 16:36
-
-
Save abc873693/6976cdb981c5ec505dafd6b0579904bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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