Check-in [954b32bc58]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[REQUEST.BAS] - Implement a function to read a specified number of chars from the STDIN. - Implement the function to manage the POST requests using the STDIN.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:954b32bc58a45829462921658d523195bd3ba78d
User & Date: Administrador 2016-10-06 01:06:33
Context
2016-10-06
01:08
[MAIN] - Include Request.bas in main application file. check-in: 36574bd679 user: Administrador tags: trunk
01:06
[REQUEST.BAS] - Implement a function to read a specified number of chars from the STDIN. - Implement the function to manage the POST requests using the STDIN. check-in: 954b32bc58 user: Administrador tags: trunk
01:03
[REQUEST.BAS] - Implement the QueryString function to manage the GET requests. check-in: 4d4754a9f7 user: Administrador tags: trunk
Changes

Changes to root/core/request.bas.

1
2


















3
4
5
6
'################################# Request.bas #################################
'HTTP Requests management functions.



















FUNCTION QueryString$ (arg$)
  QueryString$ = UnEscape$(SplitVar$(ENVIRON$("QUERY_STRING"), arg$, CHR$(38)))
END FUNCTION


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'################################# Request.bas #################################
'HTTP Requests management functions.

FUNCTION ReadStdin$
  DIM numChars, postQuery$
  IF ENVIRON$("REQUEST_METHOD") = "POST" THEN
    numChars = VAL(ENVIRON$("CONTENT_LENGTH"))
    postQuery$ = INPUT$(numChars)
    ReadStdin$ = postQuery$
  ELSE
    ReadStdin$ = ""
  END IF
END FUNCTION

COMMON SHARED StdinQuery$
StdinQuery$ = ReadStdin$

FUNCTION Post$ (arg$)
  Post$ = UnEscape$(SplitVar$(StdinQuery$, arg$, CHR$(38)))
END FUNCTION

FUNCTION QueryString$ (arg$)
  QueryString$ = UnEscape$(SplitVar$(ENVIRON$("QUERY_STRING"), arg$, CHR$(38)))
END FUNCTION