I want to pass q parameter in setEndPoint url to get list of all files in the root folder(at the home page). I tried it using the google API(https://developers.google.com/drive/api/v3/reference/files/list) it is working there,but when I try to use in for REST API it generates error.Following is my url
HttpRequest req = new HttpRequest();
req.setMethod('GET'); // Http method of get is used here.
// setEndPoint url parameters are passed
req.setEndpoint('https://www.googleapis.com/drive/v3/files?corpora=user,allTeamDrives&includeTeamDriveItems=true&supportsTeamDrives=true&q=\'root\'in parents');
This generates an error on my vf page. As soon as I remove q parameters the error is removed