Teapot icon indicating copy to clipboard operation
Teapot copied to clipboard

Ajax-based form request parameters are not detected

Open gbosetti opened this issue 5 years ago • 1 comments
trafficstars

Hi. I realized that there is a problem when retrieving the form-based request parameters performed with ajax. More details and my solution here: https://stackoverflow.com/questions/62971100/how-to-pass-a-non-url-request-parameter-to-smalltalk-teapot-from-ajax-call

Well, in fact, I had to extend the request class so I can access the znRequest instance to ask for the entity and its content. Best,

gbosetti avatar Jul 19 '20 02:07 gbosetti

Hi, sorry for the late response. The req at: #name is for accessing the key value pairs in a application/x-www-form-urlencoded request (I'm not sure what content-type you used in the ajax request). This is effectively the same as if they were in the query string ?key1=value2&key2=value2 but they're encoded in the request body. If you want to access the raw request you can use the req entity as you did.

zeroflag avatar Aug 29 '22 19:08 zeroflag