Curl发送数据json超时
我需要连接具有以下特征的REST类型webservices: 邮电 UTF-8编码 必须使用电子证书 请愿书由一个头和一个身体组成Curl发送数据json超时,json,windows,curl,certificate,head,Json,Windows,Curl,Certificate,Head,我需要连接具有以下特征的REST类型webservices: 邮电 UTF-8编码 必须使用电子证书 请愿书由一个头和一个身体组成 HEAD: Accept-Encoding = "gzip". Content-Encoding = "gzip". Content-Length = size Content-Type = "application/octet-stream". eus-bizkaia-n3-version =
HEAD:
Accept-Encoding = "gzip".
Content-Encoding = "gzip".
Content-Length = size
Content-Type = "application/octet-stream".
eus-bizkaia-n3-version = "1.0".
eus-bizkaia-n3-content-type = "application/xml".
eus-bizkaia-n3-data = contenido del fichero json
json文件的内容如下所示:
{
"con": "LROE",
"apa": "1.1",
"inte": {
"nif": "número de identificación fiscal",
"nrs": "nombre o Razón social",
"ap1": "primer apellido",
"ap2": "segundo apellido"
},
"drs": {
"mode": "140/240",
"ejer": "ejercicio"
}
}
curl.exe -X POST -i -H "Expect:" -H "Accept-Encoding:gzip" -H "Content-Encoding:gzip" -H "Content-Length:37430" -H "Content-Type:application/octet-stream" -H "eus-bizkaia-n3-version:1.0" -H "eus-bizkaia-n3-content-type:application/xml" -H "eus-bizkaia-n3-data:" -d @sarrerak_header_info.json -d @[NAME OF FILE TO SEND] --insecure --key key.pem --cacert firma.pem --cert client.pem: [CERTIFICATE KEY] https://pruesarrerak.bizkaia.eus/N3B4000M/aurkezpena -o resultado.html
我们正在使用的json文件包含以下内容:
con "LROE"
apa "1.1"
inte
nif "B99999999"
nrs "EMPRESA”
ap1 " "
ap2 " "
drs
mode "240"
ejer "2020"
电子证书包含在HTTP标头中
Body:
它由一个带有gzip编码(压缩格式)的文件组成,并将其包含在请求体中。
我曾尝试使用crul执行此操作,但它没有正确连接到服务。具体安排如下:
{
"con": "LROE",
"apa": "1.1",
"inte": {
"nif": "número de identificación fiscal",
"nrs": "nombre o Razón social",
"ap1": "primer apellido",
"ap2": "segundo apellido"
},
"drs": {
"mode": "140/240",
"ejer": "ejercicio"
}
}
curl.exe -X POST -i -H "Expect:" -H "Accept-Encoding:gzip" -H "Content-Encoding:gzip" -H "Content-Length:37430" -H "Content-Type:application/octet-stream" -H "eus-bizkaia-n3-version:1.0" -H "eus-bizkaia-n3-content-type:application/xml" -H "eus-bizkaia-n3-data:" -d @sarrerak_header_info.json -d @[NAME OF FILE TO SEND] --insecure --key key.pem --cacert firma.pem --cert client.pem: [CERTIFICATE KEY] https://pruesarrerak.bizkaia.eus/N3B4000M/aurkezpena -o resultado.html
我总是得到以下回应:
HTTP/1.1 408 Request Timeout Date: Mon, 16 Nov 2020 14:16:05 GMT Server: Apache/2.4.29 (Red Hat) Content-Length: 221 Connection: close Content-Type: text/html; charset=iso-8859-1
Request Timeout
Server timeout waiting for the HTTP request from the client