[Solved] Problem about rest-api on STL plugin, with 400 client error

Surprisingly, as soon as I posted the problem, I found the reason. It seems like when there are no study corresponding to the ‘Parent’ field in database, it will go with error. I deleted the field and it’s OK.

Problem Introduction

Hello! I tried to use the new plugin STL plugin for Orthanc, and also tried the sample code in DICOM-ization of STL files, but failed.

Getting 400 Client Error:

Environment Info

  • System: Win64
  • Version: Win64-24.4.0
  • Python: 3.12.2

Other Efforts

I am a beginner so I wonder if I made any mistakes when config rest-api.

  1. I have already set the "HttpServerEnabled": true, and "Plugins": ["D:/Orthanc Server/Plugins/OrthancSTL.dll"],.
  2. I also tried curl http://localhost:8042/patients to test, getting OK response.

I will appreciate if there are any helping hands. :slight_smile:

The console output:

T0425 16:59:33.109325          HTTP-29 HttpServer.cpp:1186] (http) HTTP header: [host]: [localhost:8042]
T0425 16:59:33.113668          HTTP-29 HttpServer.cpp:1186] (http) HTTP header: [user-agent]: [python-requests/2.31.0]
T0425 16:59:33.117659          HTTP-29 HttpServer.cpp:1186] (http) HTTP header: [accept-encoding]: [gzip, deflate, br]
T0425 16:59:33.123809          HTTP-29 HttpServer.cpp:1186] (http) HTTP header: [accept]: [*/*]
T0425 16:59:33.125278          HTTP-29 HttpServer.cpp:1186] (http) HTTP header: [connection]: [keep-alive]
T0425 16:59:33.131660          HTTP-29 HttpServer.cpp:1186] (http) HTTP header: [content-length]: [348647]
I0425 16:59:33.133712          HTTP-29 HttpServer.cpp:1262] (http) POST /tools/create-dicom

Hello,

I would happily help here, but please post your plain Python source code and a sample STL file instead of a screenshot. We need minimum working examples to efficiently provide support.

Kind Regards,
Sébastien-

1 Like

Thanks for suggestion. I will modify my question.