'Handle a POST request from the client
Used by the APIs for comment threads, commentables, comments,
subscriptions, commentables, users'

def do_POST(self):

    length = int(self.headers.getheader('content-length'))
    data_string = self.rfile.read(length)
    post_dict = json.loads(data_string)
    logger.debug('Comment    Service    received    POST    request    {0}    to    path    {1}'.format(json.dumps(post_dict), self.path))
    if ('X-Edx-Api-Key' in self.headers):
        response = self.server._response_str
        logger.debug('Comment    Service:    sending    response    %s', json.dumps(response))
        self.send_response(200)
        self.send_header('Content-type', 'application/json')
        self.end_headers()
        self.wfile.write(response)
    else:
        self.send_response(500, 'Bad    Request:    does    not    contain    API    key')
        self.send_header('Content-type', 'text/plain')
        self.end_headers()
        return False
