简体   繁体   English

如何使用 python 一对一地推送数据 API

[英]how to push data one bye one array API using python

how to push data one bye one array API using python如何使用 python 一对一地推送数据 API

import xml
import requests

with open("main.xml") as f:
    data = xml.load(f)
    for line in data:
        r = requests.post('URL',xml=line)
        print(r.status_code)

You can use xml.etree.ElementTree您可以使用 xml.etree.ElementTree

It has various methods for different objective.针对不同的目标,它有多种方法。

Please have a look of link for more details https://docs.python.org/3/library/xml.etree.elementtree.html请查看链接了解更多详情https://docs.python.org/3/library/xml.etree.elementtree.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Z23EEEB4347BDD26BFC6B7EE9A3B75 从 JSON 数组中将 json 值一一推送到 API - how to push json values to API one by one from JSON array using python 如何使用Python一一拆分动态数组值? - How to split the dynamic array values one by one using Python? 如何在Python中根据另一个数组中的值提取一个数组中的数据 - How to extract data in one array according to the values in another array in Python 使用for循环Python将数组数据保存在一个输出文件中 - Save array data in one output file using for loop Python 如何将值从一个数组推送到另一个数组,一个接一个的索引 - How to push value from an array to another, one by one index 芹菜,一个再见一个队列,并行许多时间队列 - celery, one bye one queue and parallel many in time queues 如何使用 Python 2.7 通过 YoBit API 进行身份验证? - How does one authenticate with the YoBit API using Python 2.7? 如何匹配两个 API 以使用 Python 更新一个 API 数据集 - How to Match two APIs to update one API dataset using Python 如何使用 python 在 csv 文件中逐行读取一列数据 - How to read one column data as one by one row in csv file using python 将多列数据放入一个数组中,python - Putting multiple columns of data into one array, python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM