keikaavousi/fake-store-api

522 on node v18.15.0

abhi-dasgupta opened this issue · 2 comments

I am using request.get in node and everything works fine, however when I host the app the body is always returned empty. Also, it worked fine until yesterday, then it started getting 522, ever since that got fixed, I have been getting an empty body. I am confused, because there are no errors, and everything works fine on my machine

const request = require('request');

// Request URL
const url = 'https://fakestoreapi.com/products/categories?limit=100';

request(url, (error, response, body) => {
  // Printing the error if occurred
  if (error) console.log(error);

  // Printing status code
  console.log(response.statusCode);

  // Printing body
  console.log(body);
});

above test code works on node v16.16.0 but returns 522 on v18.15.0
if the change the URL to https://jsonplaceholder.typicode.com/todos/1 it works

Does your problem still exist?