csingley / ofxtools

Python OFX Library
Other
301 stars 68 forks source link

Enhancement request: add flag --writeReqResp <dirName> to write out HTTP headers and OFX request/response #76

Closed hleofxquotes closed 4 years ago

hleofxquotes commented 4 years ago

Add option to ofxget to write request/response

to a specified directory. This will help new user to learn what was sent and what was returned from the OFX server.

For example

python ./ofxtools/scripts/ofxget.py  prof amex  --writeReqResp amex

Will write to directory 'amex' in current directory the following files

in case the 'action' such as (--all) has multiple requests, subsequent requests will get label

csingley commented 4 years ago

ofxget already will dump the RQ/RS, basically:

ofxget stmt -n amex > amex/dummy-rq.ofx
ofxget stmt amex > amex/rs.ofx

Does this not suffice?

For the headers, I'd think it would be better to log them if desired... but they're not very interesting.

Cf. ofxtools.Client.OFXClient.http_headers(), line 257 et seq. If you're developing other OFX utilities, I guess what you're looking for is explained in the comment therein... blank User-Agent.