asp.net - How to get JSON back from HTTP POST Request (to another domain) -
I am trying to use an API on a website, here is part of the manual:
Authenticated Sessions (taken from)
To create an authenticated session, you must request a authToken from the '/ authentication' API resource.
- URL: (This is not my domain)
- Method: Post
- Request format: Application / x- Www form- urlencoded
- Feedback format: application / xml, application / json
- Feedback code: 200 OK
- Response body:. Authenticated user details, including API version
-
Additional data:. The "authToken" cookie and header containing the authentication token that should be used for incoming calls
parameter: username / password
example < / H2> request
accepting post / certification HTTP / 1.1: application / xml
content type: application / x-www form-urlencoded
users Name = my_username and password = my_password
Response
HTTP / 1.1 200 OK Set Cookies: authToken = 1KVARbypAjxLGViZ0Cg + UskZEHmqVkhx / PM ...;
authToken: 1KVARbypAjxLGViZ0Cg + UskZEHmqVkhx / PmEvzkPGp ... ==
Content-type: Application / xml; Charset = UTF-8
Question:
How do I work out this?
I tried jQuery, but it seems that there is a problem with XSS. The actual code snippet will be highly appreciated.
ps
I was looking at all the class C #
You enter Application / Jason in your Accept header, it tells the server that you want to respond to that format - not xml.
Comments
Post a Comment