ReadCGI() no return size

Post bugreports for the Linux version here
acidorus
New User
New User
Posts: 2
Joined: Mon Apr 29, 2024 10:06 pm

ReadCGI() no return size

Post 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>")
Fred
Administrator
Administrator
Posts: 18393
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: ReadCGI() no return size

Post by Fred »

Should be fixed in beta 5.
acidorus
New User
New User
Posts: 2
Joined: Mon Apr 29, 2024 10:06 pm

Re: [Done] ReadCGI() no return size

Post by acidorus »

I tested it here and it continues to return zero in version 6.30 beta 5.
Post Reply