Closed andreasolund closed 7 years ago
When you try to send JSON data with a GET request which obviously isn't recommended/possible; Vane still tries to parse a request which has an empty body.
I've included a sample client and server that should reproduce the issue:
import 'dart:html'; //... HttpRequest.request("/magrathea", method: "GET", requestHeaders: {"Content-Type": "application/json"}, sendData: '{"name":"Zaphod"}' ).then((response) { print(response.responseHeaders); print(response.responseText); }) //...
import 'dart:io'; import 'dart:async'; import 'package:vane/vane.dart'; class MagratheaService extends Vane { @Route("/magrathea") Future main() { print(json); return close("OK"); } }
We should probably throw an exception that gives developers a hint of what went wrong.
Hello, thanks for the bug report! This is now fixed and published. :+1:
When you try to send JSON data with a GET request which obviously isn't recommended/possible; Vane still tries to parse a request which has an empty body.
I've included a sample client and server that should reproduce the issue:
Client
Server
We should probably throw an exception that gives developers a hint of what went wrong.