postData() async {
try {
var response = await http.post(
Uri.parse("https://zen-api-1010.azure-api.net/notes/v1/create"),
headers: {
"Content-type": "application/json",
"Accept": "application/json",
"Ocp-Apim-Subscription-Key": "008c47b597e54aedadbd5e4d270b35ed",
"Ocp-Apim-Trace": "true"
},
body: jsonEncode({
"noteType": 0.toString(),
"description": "KUSHAN 1".toString(),
"authorReaction": 0.toString(),
"privacy": 0.toString(),
}));
print(response.statusCode);
} catch (e) {
print(e);
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter