参数列表太长 - 卷曲 - GeoJSON

时间:2016-12-06 21:31:13

标签: bash curl geojson

我正在尝试使用以下bash代码将GeoJSON提供给此data service

      xpath "//*[contains(@title,'Node-1: Instance #1')]

然而,我得到一个"参数列表太长"错误。我在堆栈上看到很多与此问题相关的问题,但我不明白如何将这些线程中给出的答案转换为这个特定情况。

1 个答案:

答案 0 :(得分:4)

您应该使用<filename@filename

curl -X POST \
     -F 'shape=<myfile.geojson' \
     -F 'age=69' \
     -o 'reconstructed_myfile.geojson' \
     -- 'https://dev.macrostrat.org/reconstruct'

有关详细信息,请参阅man curl

$ man curl | awk '$1 ~ /-F/' RS=
   -F, --form <name=content>
          (HTTP) This lets curl emulate a filled-in form in which a user has
          pressed the submit button. This causes curl to POST data  using  the
          Content-Type  multi‐ part/form-data  according  to RFC 2388. This
          enables uploading of binary files etc. To force the 'content' part to
          be a file, prefix the file name with an  @ sign.  To just get the
          content part from a file, prefix the file name with the symbol <. The
          difference between @ and < is then  that  @  makes  a  file  get
          attached in the post as a file upload, while the < makes a text field
          and just get the contents for that text field from a file.