Question: So I was having issues with flutter http package when it came to making a post request so I used dart HttpClient. I made a post request according to what was described somewhere but I am having issues getting response. Here is my code

```
 Future<HttpClientResponse> submit() async {
 print('start');
  Map<String, dynamic> data = { 'title' : 'My first post' };
  String jsonString = json.encode(data); // encode map to json
  String paramName = 'param'; // give the post param a name
  String formBody = paramName + '=' + Uri.encodeQueryComponent(jsonString);
  List<int> bodyBytes = utf8.encode(formBody); // utf8 encode
  HttpClientRequest request =
      await HttpClient().postUrl(Uri.parse('https://jsonplaceholder.typicode.com/posts'));
  // it's polite to send the body length to the server
  request.headers.set('Content-Length', bodyBytes.length.toString());
  request.headers.set('Content-Type', 'application/json');
  request.add(bodyBytes);
  print('done');
  return await (request.close());
}

```

How do I get the response from this request?

Answer: 
The way you do it above is correct. You should, in principle, never use `fit` on test data, only on the train data. The fact that you get "better" results using `fit_transform` on the test data is not indicative of any real performance gains. In other words, by using `fit` on the test data, you lose the ability to say something meaningful about the predictive power of your model on unseen data.

The main lesson here is that any gains in test performance are meaningless once the methodological constraints (i.e. train-test separation) are violated. You may obtain higher scores using `fit_transform`, but these don't mean anything anymore.
when you want to transform a data you should declare that.
like:

```
data["afs"]=data["afs"].transform()

```