Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Provide Content-Type header in request
Browse files Browse the repository at this point in the history
Issue: #5
  • Loading branch information
aharbis committed Jan 7, 2020
1 parent 495c066 commit 27a9c59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dp_file_uploader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def process_file(filename, directory, url, user, password):
xml = build_xml(directory, target_filename, data)
if VERBOSE:
print('Sending POST request')
r = requests.post(url, auth=(user, password), data=xml, verify=False)
headers = { 'Content-Type': 'text/xml' }
r = requests.post(url, auth=(user, password), data=xml, headers=headers, verify=False)
if VERBOSE:
print('HTTP Request Headers:', r.request.headers)
print('HTTP Response Code:', r.status_code)
Expand Down

0 comments on commit 27a9c59

Please sign in to comment.