python import furl url = furl.furl('https://www.example.com/path/?param1=value1&param2=value2#frag') python import furl url = furl.furl('https://www.example.com') url.scheme = 'http' url.path.segments.extend(['new', 'path']) url.args['param'] = 'value' url.fragment = 'new_frag' url.args.add({'param2': 'value2', 'param3': 'value3'}) url.args.remove('param') url.remove(args=True) python import furl url = furl.furl('https://www.example.com/path/?param=name%3A%E5%BC%A0%E4%B8%89') decoded_param = url.args["param"].decode('utf-8') encoded_param = "age:30".encode('utf-8') url.args['param'] = encoded_param


上一篇:
下一篇:
切换中文