Skip to content

Instantly share code, notes, and snippets.

@tugberkugurlu
Created May 27, 2012 12:10
Show Gist options
  • Save tugberkugurlu/2811936 to your computer and use it in GitHub Desktop.
Save tugberkugurlu/2811936 to your computer and use it in GitHub Desktop.

Controller

public class AuthController : ApiController {

    public HttpResponseMessage Post(string email, string userName, string password) {

        return new HttpResponseMessage(HttpStatusCode.OK);
    }
}

Request

POST http://localhost:49213/api/auth HTTP/1.1
Host: localhost:49213
Content-Type: application/json
Content-Length: 73

{userName: "tugberk", email: "tugberk@example.com", password: "12345678"}
@AlexZeitler
Copy link

This one works:

Controller method:

public void Post(string value1, string value2, string value3) { }

Request:

POST http://localhost:42623/api/values HTTP/1.1
User-Agent: Fiddler
Content-type: application/x-www-form-urlencoded
Host: localhost:42623
Content-Length: 32

value1=123&value2=234&value3=345

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment