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: 
> 
> Should I follow the documentation of StandardScaler such that the test dataset MUST be transformed only using ".transform()" without fit() function? Or it depends on the dataset such that I can use the "fit\_transform()" function for both training and testing datasets?
> 
> 
> 

The moment you are re-training your scaler for the testing set you will have a different dependincy of your input features. The original algorithm will be fitted based on the fitting of your training sacling. And if you re-train it this will be overwritten, and you are faking your input of the test data for the algorithm.

So the answer is **MUST** only be transformed.
when you want to transform a data you should declare that.
like:

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

```