Skip to content

Commit

Permalink
Client.OFXClient.http_headers - add Accept application/xml MIME type
Browse files Browse the repository at this point in the history
Apparently Amex's OFX server insists that the HTTP Accept header
contan application/xml with some sort of quality rating - ANY
quality rating, it would seem.
  • Loading branch information
csingley committed Nov 18, 2020
1 parent 0230fad commit 823293b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ofxtools/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ def http_headers(self) -> Dict[str, str]:
return {
"User-Agent": "",
"Content-type": mimetype,
"Accept": "*/*, {}".format(mimetype),
# Apparently Amex is unhappy unless it sees a MIME type of application/xml
# with some quality rating - ANY quality rating, it seems.
"Accept": "*/*, {}, application/xml;q=0.9".format(mimetype),
}

def dtclient(self) -> datetime.datetime:
Expand Down

0 comments on commit 823293b

Please sign in to comment.