post request work great in postman but in flutter it gives status code 500 can anyone help me out iam attaching all the stuff

320 views
Skip to first unread message

Mohd Arshad

unread,
Mar 24, 2021, 6:40:00 AM3/24/21
to Flutter Development (flutter-dev)

Screenshot (105).pngScreenshot (106).pngScreenshot (101).pngScreenshot (102).pngScreenshot (103).pngScreenshot (104).png
//post request code
//--payload is 
 Map<String, dynamic> requestPayload = {
    "id": 1,
    "method": "auth.login",
    "params": ["deluge"]
  };
 http.Response response = await http.post(
      body: json.encode(requestPayload),
      headers: {
        // 'Content-Type': 'application/json',
        // 'Accept': "application/json",
        'Content-Type': 'application/json'
      },
    );
    updateCookie(response);
    //return json.decode(response.body);
    print(response.statusCode);
    //print(response.headers);
    print("cookie is " + response.headers['cookie-set'].toString());


can anyone help me , please help ,, .... iam fighting with this problem from last 3 days but i am not able to figure out where iam lacking please help

Suzuki Tomohiro

unread,
Mar 24, 2021, 8:51:23 AM3/24/21
to Mohd Arshad, Flutter Development (flutter-dev)
Read server-side log file. 500 is a server side error. You cannot resolve that by looking at client code.

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/a312da5a-f0b4-4933-adf7-598be035eebcn%40googlegroups.com.

Suzuki Tomohiro

unread,
Mar 26, 2021, 1:03:40 AM3/26/21
to Flutter Development (flutter-dev)
Glad to hear it’s resolved.

On Fri, Mar 26, 2021 at 01:02 Mohd Arshad <www.moa...@gmail.com> wrote:
yeah thank you it solved now , it was problem from server side
Reply all
Reply to author
Forward
0 new messages