Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
SkipFire
Visitor

Post with JSON

I've looked through docs and post and haven't found an answer yet, so how do I send JSON as part of a post request? The ParseJSON piece I need to use on the return shouldn't be a problem, but I have to submit JSON along with the post in order to get the JSON return. Below is a javascript version of what I need to do.

function GetData(requestType, requestValue) {
var Request = { RequestType: requestType, RequestValue: requestValue };
urlToHandler = 'JSONHandler.ashx';
jsonData = JSON.stringify(Request, null, 2);
$.ajax({
url: urlToHandler,
data: jsonData,
dataType: 'json',
type: 'POST',
contentType: 'application/json',
success: SuccessFunction,
error: function (data, status, jqXHR) {
alert('There was an error.');
}
});
}
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.