[英]How to construct an HTTP GET request to filter a JSON response?
我正在使用Curl发出以下HTTP GET请求:
卷曲http://rest.ensembl.org/variation/human/rs56116432?content-type=application
它返回以下JSON对象:
{"source":"Variants (including SNPs and indels) imported from dbSNP","mappings":[{"location":"9:133256042-133256042","assembly_name":"GRCh38","end":133256042,"seq_region_name":"9","strand":1,"coord_system":"chromosome","allele_string":"C/T","start":133256042},{"location":"CHR_HG2030_PATCH:133256189-133256189","assembly_name":"GRCh38","end":133256189,"seq_region_name":"CHR_HG2030_PATCH","strand":-1,"coord_system":"chromosome","allele_string":"C/T","start":133256189}],"name":"rs56116432","MAF":"0.00259585","ambiguity":"Y","var_class":"SNP","synonyms":[],"evidence":["Multiple_observations","Frequency","1000Genomes","ESP","ExAC"],"ancestral_allele":"C","minor_allele":"T","most_severe_consequence":"missense_variant"
是否可以构造HTTP请求,以便仅将键"most_severe_consequence"
值返回给浏览器,而不是在返回请求后过滤数据?
API 文档不包含特定示例。
您可以添加查询参数,该参数需要响应的组成部分。
另外,如果您只想要一个字段,则可以有一个额外的path元素。
http://rest.ensembl.org/variation/human/rs56116432/most_severe_consequence?content-type=application
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.