Page 1 of 1

[Done] ReadCGI() no return size

Posted: Tue Oct 28, 2025 11:17 am
by acidorus
Hello, from version 6.21, 630, readCGI no longer returns the size and no longer reads a Json sent via POST.
In version 6.20 it works perfectly.

Code: Select all

curl --location 'https://site.com/rep-bin/get' \
--header 'Content-Type: application/json' \
--data '{
    "rep": {
      "data": ["2023-04-20"]
    }
}'
ex:

Code: Select all

 If Not InitCGI()
    End
  EndIf
  
  Define BufferSize = ReadCGI()
  Define httpContentLength = Val(Trim(CGIVariable(#PB_CGI_ContentLength)))
  Define *buff=CGIBuffer()
  
  WriteCGIHeader(#PB_CGI_HeaderContentType, "text/html", #PB_CGI_LastHeader) ; Write the headers to inform the browser of the content format

  WriteCGIString("<html><title>PureBasic - raw buffer</title><body>")  
 
  If *buff
    WriteCGIString("Raw buffer content: <br><pre>"+Str(*buff)+" > "+Str(httpContentLength)+" > " +Str(BufferSize)+" > "+ PeekS(*buff, BufferSize, #PB_Ascii) + "</pre>")
  EndIf
  
  WriteCGIString("</body></html>")

Re: ReadCGI() no return size

Posted: Mon Dec 08, 2025 2:18 pm
by Fred
Should be fixed in beta 5.

Re: [Done] ReadCGI() no return size

Posted: Tue Dec 09, 2025 5:54 pm
by acidorus
I tested it here and it continues to return zero in version 6.30 beta 5.

Re: ReadCGI() no return size

Posted: Mon Jan 05, 2026 2:55 pm
by Fred
Fixed.

Re: [Done] ReadCGI() no return size OK

Posted: Wed Jan 07, 2026 1:43 pm
by acidorus
Working perfectly now, thank you very much. :D