Hey guys, can't see what is wrong with my code, I keep getting the error
Status: 500 Internal Server Error
Content-Type: text/html

<html><body><h1>500 Internal Server Error</h1></body></html>

import httplib
import sys
import time

#Initial connection to the server
def connectingToServer(port, message, path):
    connection = httplib.HTTPConnection('rpc248.cs.man.ac.uk', port)
    headers = {'Content-type': 'application/xml', 'Accept': 'application/xml'}
    connection.request('PUT', path, message, headers)
    print path, message, headers
    response = connection.getresponse()
    print response.status, response.reason
    return response
    
def get(port, username, password, path, message):
    path = path + '?username=' + username + '&password=' + password
    connection = httplib.HTTPConnection('rpc248.cs.man.ac.uk', port)
    connection.request('GET', path)
    response = connection.getresponse()
    print response.status, response.reason
    return response

username = 'buckled0'
password = 'EBqZRr'
requestID = time.time()
port = '3020'
message = '<reserve><request_id>'+str(requestID)+'</requestid><username>buckled0</username><password>EBqZRr</password><slot_id>100</slot_id></reserve>'
path = '/queue/enqueue'  
initialConnection = connectingToServer(port, message, path)
res = initialConnection.read()
if initialConnection.status == 200:
    print "Page has been found, outputting Request Body"
    print res
elif initialConnection.status == 404:
    print "Page not found"
elif initialConnection.status == 503:
    print "Service is unavailable"
elif initialConnection.status == 401:
    print "Invalid username/password"

will u provide more details?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.