Update for POST 2

This commit is contained in:
Ankit Mahato
2024-03-12 02:04:01 +05:30
parent 4d4380f3aa
commit 2d5186bdf8
3 changed files with 18 additions and 3 deletions

View File

@ -398,7 +398,12 @@ import 'dart:convert' as convert;
void main() async { void main() async {
try { try {
final data = convert.json.decode(r'''{ final data = convert.json.decode(r'''{
"text": "I LOVE Flutter" "text": "I LOVE Flutter",
"flag": null,
"male": true,
"female": false,
"no": 1.2,
"arr": ["null", "true", "false", null]
}'''); }''');
final response = await dio.Dio.post( final response = await dio.Dio.post(
'https://api.apidash.dev/case/lower', 'https://api.apidash.dev/case/lower',

View File

@ -428,7 +428,12 @@ fun main() {
val mediaType = "application/json".toMediaType() val mediaType = "application/json".toMediaType()
val body = """{ val body = """{
"text": "I LOVE Flutter" "text": "I LOVE Flutter",
"flag": null,
"male": true,
"female": false,
"no": 1.2,
"arr": ["null", "true", "false", null]
}""".toRequestBody(mediaType) }""".toRequestBody(mediaType)
val request = Request.Builder() val request = Request.Builder()

View File

@ -326,7 +326,12 @@ print(data.decode("utf-8"))
const expectedCode = r"""import http.client const expectedCode = r"""import http.client
body = r'''{ body = r'''{
"text": "I LOVE Flutter" "text": "I LOVE Flutter",
"flag": null,
"male": true,
"female": false,
"no": 1.2,
"arr": ["null", "true", "false", null]
}''' }'''
headers = { headers = {