AWS Lambda python API call method not returning JSON - not serialisable?

I've resolved this - the problem with my Python code is that it was trying to return the entire response, rather than simply the JSON body (the code for my local version prints 'response.text'). In addition, I have ensured that the response is JSON formatted (rather than raw text). Updated code:

import requests
import json
url = "http://url/api/projects/"
headers = {
   'content-type': "application/json",
   'x-octopus-apikey': "redacted",
   'cache-control': "no-cache"
    }

def lambda_handler(event, context):
    response = requests.request("GET", url, headers=headers)           
    try:
        output = response.json()
    except ValueError:
        output = response.text
    return output