使用httpReguest或Webrequest上传文件

时间:2018-01-10 21:02:34

标签: c# asp.net csv post webrequest

我想将csv文件上传到人口普查地理编码网站并获取csv文件,但无论我如何调整代码,我都会遇到webexception错误或卡在请求上。如果您有任何建议或处理过这类问题,请分享您的两分钱。在编写字符串params /连接它们时,我不是专家 这是我的烂摊子

E:\Work\Dev\StackOverflow\q48194775>"c:\Install\x86\Python\Python\3.6\python.exe"
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> with open("uc.jsn", "rb") as f:
...     raw_content = f.read()
...
>>> with open("uc0.jsn", "wb") as f:
...     f.write(raw_content.replace(b"\0", b""))
...
22
>>> import json
>>> with open("uc0.jsn", "r") as f:
...     print("    {}".format(json.load(f)))
...
    {'dummy': 0}
>>> with open("uc.jsn", "r") as f:
...     print("    {}".format(json.load(f)))
...
Traceback (most recent call last):
# The rest of the traceback 

0 个答案:

没有答案
相关问题