Hi all
I'm trying to create an HTTP request following this:
POST /quiter/qae/... HTTP/1.1
Host: ...:8000
Content-Length: 592
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="attachmentMetadata"
{"referenciaDms" : "...","ficheroDms" : "...","usuario" : "quiter","descripcion" : "prueba","workspace" : "quiter"}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="/u2/quiter/DATOS/qsac_quiter.png"
Content-Type: image/png
(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW--
--
My BASIC code is like this
NOM.SUB='RU2'
URL.SERVICIO='http://...:8000/quiter/qae/...'
TIPO.LLAMADA='POST:multipart/form-data'
RESPUESTA=setHTTPDefault('VERSION','1.1')
RESPUESTA=createRequest(URL.SERVICIO,TIPO.LLAMADA,HTTP.HANDLE)
ADDPARAM='{"referenciaDms" : "85818","ficheroDms" : "FMVEHPT","usuario" : "quiter","descripcion" : "prueba","workspace" : "quiter"}'
RESPUESTA=addRequestParameter(HTTP.HANDLE,'attachmentMetadata',ADDPARAM,'multipart/form-data')
RESPUESTA=addRequestParameter(HTTP.HANDLE,'file','/u2/quiter/DATOS/qsac_quiter.png','multipart/form-data')
TIME.OUT=10
DATOS.POST=''
RESPUESTA=submitRequest(HTTP.HANDLE,TIME.OUT,DATOS.POST,CABECERA.RESPUESTA,DATOS.RESPUESTA,HTTP.STATUS)
CRT NOM.SUB:' HTTP.STATUS [':HTTP.STATUS:'] ':TIME()
CRT NOM.SUB:' RESPUESTA FINAL [':RESPUESTA:'] ':TIME()
CRT NOM.SUB:' DATOS.RESPUESTA [':DATOS.RESPUESTA:'] ':TIME()
And the response is telling me that the data is not arriving on the expected place
RU2 HTTP.STATUS [422²Unprocessable Entity] 35816.43
RU2 RESPUESTA FINAL [0] 35816.43
RU2 DATOS.RESPUESTA[
{
"detail": [{
"type": "missing",
"loc": ["body", "file"],
"msg": "Field required",
"input": null,
"url": "https://errors.pydantic.dev/2.4/v/missing"
}, {
"type": "missing",
"loc": ["body", "attachmentMetadata"],
"msg": "Field required",
"input": null,
"url": "https://errors.pydantic.dev/2.4/v/missing"
}
]
}
]35816.43
Is there a way to see what is the raw HTTP request that I'm forming, to see what info is missing?
Am I overlooking something?
------------------------------
Héctor Cortiguera
Quiter Servicios Informaticos SL
------------------------------