This mostly a duplicate question that went unanswered. GET requests work fine and var1 and var2 both become SAS variables in the receiving stored process, but POST requests are failing. Here is the sample request that works. Change it to a POST and it fails.
It seems the answer (which was mentioned in the previous thread) is to create a data source and send the stored process properly formatted XML which is painful. But, was wondering if anyone else found a way to get a POST to work.
And I've actually answered this myself extremely painfully here. Just wondering if this is the only way.
The way JQuery handles POST data is a little annoying compared to most other frameworks. It doesn't really do anything with the data you pass it for a POST, expecting you to preformat and urlencode your post body yourself so that it can just append to the request. For GET requests it serialises and encodes the data properly.
There's a little more info on the content-type subject in this post (not sure if you've seen my reply as I wrote it about 5 months after your question). It is somewhat specific to POST requests - simplest explanation I've found is on wikipedia. From the best of my knowledge, it's all to do with the old days when POST requests were used to submit form data, and x-form-www-urlencoded being the only type that allows you send duplicate parameter values (ie. how multiselects were handled in old school forms). SAS expects this contentType and takes advantage of the duplicate params capability with the whole ¶meter=firstvalue, ¶meter0=2, ¶meter1=firstvalue, ¶meter2=secondvalue approach. Conversely, multipart/form-data is what you'd use for uploading files, which is very well documented by SAS here, (I assume you know about it but others might not).
To see how our adapter handles this, see here and here.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.