Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将Python中的API查询转换为MATLAB_Python_Matlab_Rest_Post - Fatal编程技术网

将Python中的API查询转换为MATLAB

将Python中的API查询转换为MATLAB,python,matlab,rest,post,Python,Matlab,Rest,Post,我认为这应该很简单,但我很难将下面的API查询从python转换为MATLAB import json import requests url='http://amp.pharm.mssm.edu/Enrichr/addList' gstr='\n'.join([ 'PHF14','RBM3','MSL1','PHF21A','ARL10']) payload={'list':(None, gstr)} response=requests.post(url, files=payload) 下面

我认为这应该很简单,但我很难将下面的API查询从python转换为MATLAB

import json
import requests
url='http://amp.pharm.mssm.edu/Enrichr/addList'
gstr='\n'.join([
'PHF14','RBM3','MSL1','PHF21A','ARL10'])
payload={'list':(None, gstr)}
response=requests.post(url, files=payload)
下面是我在Matlab上尝试的内容

gstr = 'PHF14\nRBM3\nMSL1\nPHF21A\nARL10'
input = struct('list', gstr);
response = webwrite(url, input)
编辑: 我在MATLAB上得到以下错误

The server returned the message: "Bad Request" for URL (with HTTP response code 400)

我使用的是Matlab R2015b。

Matlab本身不支持将文件写入Web服务。
我使用了这个函数,解决了这个问题。

您遇到的实际问题是什么?您可能想看看(R2014b及以上)?本机函数webread、webwrite和urlread都不支持将文件上载到Web服务。