Nancy (C#): How do I get my post data?


Westerlund

I am using Corona SDK to post data to my C# server:

headers["Content-Type"] = "application/x-www-form-urlencoded"
headers["Accept-Language"] = "en-US"

local body = "color=red&size=small"

local params = {}
params.headers = headers
params.body = body

network.request( host .. "/UpdateHand", "POST", nwListener, params )

I get a message on the server:

  Post["/UpdateHand"] = x =>
        {
            Console.WriteLine("Received ...");
            return "Ok";
        };

However, when I inspect the data (when I put a breakpoint on it), I can't see where the data goes (ie params.body or params.headers). How to extract this information?

I should have posted it correctly according to the documentation on Corona : http://docs.coronalabs.com/daily/api/library/network/request.html

Kristin Hosdahl

post data in

this.Request.Body

If you have a suitable type, you can use model binding to deserialize data to it:

var x = this.Bind<YourType>();

Related


Nancy (C#): How do I get my post data?

Westerlund I am using Corona SDK to post data to my C# server: headers["Content-Type"] = "application/x-www-form-urlencoded" headers["Accept-Language"] = "en-US" local body = "color=red&size=small" local params = {} params.headers = headers params.body = bod

Nancy (C#): How do I get my post data?

Westerlund I am using Corona SDK to post data to my C# server: headers["Content-Type"] = "application/x-www-form-urlencoded" headers["Accept-Language"] = "en-US" local body = "color=red&size=small" local params = {} params.headers = headers params.body = bod

How to get data from POST request on Nancy 2.0?

Julian P I need to implement a POST request handler using NancyFX 2.0. I don't understand how to handle POST on Nancy 2.0 as opposed to GET request, since there is no data on the url nor in the parameter variable. My code is currently as follows: My NancyModul

How to get data from POST request on Nancy 2.0?

Julian P I need to implement a POST request handler using NancyFX 2.0. I don't understand how to handle POST on Nancy 2.0 as opposed to GET request, since there is no data on the url nor in the parameter variable. My code is currently as follows: My NancyModul

How do I get my $_Post to work

turquoise I'm trying to get my site to submit an email every time someone sends a message (now I'm struggling to get variables to work...). It's a learning process, so I'm giving it my all here, just trying to teach myself. But don't like global php commands $

How do I get my data back from my IpcMain

Nelz I am creating a drag and drop react and using electron to send and receive my file data. I received senderId and sender in console.log. How can I get the data to appear? What did I miss? Dropzone.js file const [fileNames, setFileNames] = useState([]); co

How do I get my data out of the stack

Mariano Avino My code for calculating euclidean distance. First, I read a document that had a bunch of phylogenetic distance measurements and calculated Euclidean distances from those measurements. My problem is saving the data to the output at the end of the

How do I get my data out of the stack

Mariano Avino My code for calculating euclidean distance. First, I read a document with a bunch of phylogenetic distance measurements and calculated Euclidean distances from those measurements. My problem is saving the data to the output at the end of the file

How do I get my data from the website for parsing?

username public class ODKortrijkWebservice extends AsyncTask < ODKortrijkInterface, Void, String > { private ODKortrijkInterface listener;@ Override protected String doInBackground(ODKortrijkInterface...arg0) { listener = arg0[0];

jQuery submits via post, but how do I get the content of my DIV

WEBGONDEL UG I have many div elements (with football players on them) I want to implement a submit button and send all players from my field to my MySQL database. How can I get the value (ID and other attributes of other clicked elements, which were clicked be

How can I get the path of a Nancy Razor view in a view?

line 1 I'm trying to write an extension method that will be used inside a razor view to get the file path of that view. I've tried using extension methods HtmlHelpers<T>, NancyRazorViewBasebut I can't seem to get the correct information from the view or render

How can I get the path of a Nancy Razor view in a view?

line 1 I'm trying to write an extension method that will be used inside a razor view to get the file path of that view. I've tried using extension methods HtmlHelpers<T>, NancyRazorViewBasebut I can't seem to get the correct information from the view or render

How do I post the data I get from SQL into a div in php

bob I need to make a page to display posts from database. It must have title and text in the post. I've got all the information from the database, but I don't know how to put them into the div. Currently the data I get is set into a table, but I want to put th

How do i get the facebook post id?

a7madx7 How to extract post id after posting post using Facebook method Post() or PostTaskAsync() ? I use JSON.Netsomething like this var postObject = await fb.PostTaskAsync("/me/feed", postArgs); dynamic result = JsonConvert.DeserializeObject((

How do i get the facebook post id?

a7madx7 How to extract post id after posting post using Facebook method Post() or PostTaskAsync() ? I use JSON.Netsomething like this var postObject = await fb.PostTaskAsync("/me/feed", postArgs); dynamic result = JsonConvert.DeserializeObject((

How can I pass variables from my post to my get?

programmer man I am using react/express. I have a simple web page that takes user input and uses axios.post. In my backend, I need to create a file in my get. I haven't been able to get the return function to work, I don't want to use a global variable as it h

What happened to my bitmap? How do I get the pixel data I draw?

Harry Here is my animation buffer: Bitmap PixBuffer; This is how I create it: PixBuffer = new Bitmap(ClientRectangle.Width, ClientRectangle.Height, PixelFormat.Format32bppArgb); Here is my drawing: Graphics Renderer { get { return Graphics.FromImage(PixBuffe