Erp next api post request, error 500

I am trying to create a new project on ERP using the API. The code is as follows

if user is not None and passd is not None:
			params = {'usr':user, 'pwd':passd}

			session = Session()
			auth = session.get('https://upandepaul.erpnext.com/api/method/login', params=params)

			args = {}
			
			if auth.status_code == 200:
				project = session.request('GET', 'https://upandepaul.erpnext.com/api/resource/Project?filters=[["Project", "user", "=", "%s"]]' %user).json()
				company = session.request('GET', 'https://upandepaul.erpnext.com/api/resource/Company?filters=[["Company","Email","=","%s"]]' %user).json()
				comp_name = company['data'][0]['name']
				warehouse = session.request('GET', 'https://upandepaul.erpnext.com/api/resource/Warehouse?filters=[["Warehouse", "Company", "=", "%s"]]' %comp_name).json() 

                            #POST REQUEST FAILS
				data = json.dumps({'name':'Paul Store'})
				sess_post = session.post('https://upandepaul.erpnext.com/api/resource/Project', data="data="+data, headers={'Content-type':'application/json'})

				print dir(sess_post)
				print sess_post.reason
				print sess_post.cookies

				#http://192.168.3.27/api/resource/Project?filters=[[%22Project%22,%20%22user%22,%20%22=%22,%20%22paul@upande.com%22]]

				args['project'] = project
				args['warehouse'] = warehouse

				return render(request, 'index.html' , args)

the point of issue is the POST Request that is failing, please help thanks

I think you also need to append the session id in the headers for authentication

In all your post examples they don’t have authentication headers as a guideline

Check your bench logs for any errors

for future reference

from this github repo there is frappeclient.py script it will enable you to interact with the doctypes via API just follow the example from github