How to handle Http Error 405 Method Not Allowed? - wcf

I am trying to access REST service hosted on console application from ajax GET/POST. As there will be different ports used in two applications , I have configured REST service to handle cross origin requests. I have tried every available solution , still I am unable to access the service from ajax and getting 405.
I am sharing Raw request-response stream captured by http analyser.
OPTIONS /Service/Contacts?_145***************** HTTP/1.1
Accept: */*
Origin: http:localhost:1053
Access-Control-Request-Method: GET
Access-Control-Request-Headers: access-control-allow-origin, access-control-allow-methods
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Host: bhawesh-pc:8000
DNT: 1
Connection: Keep-Alive
Cache-Control: no-cache
Content-Length: 0
HTTP/1.1 405 Method Not Allowed
Allow: POST, GET
Content-Type: text/html; charset=UTF-8
Server: Microsoft-HTTPAPI/2.0
Access-Control-Allow-Origin: *
Access-Control-Request-Method: POST,GET,PUT,DELETE,OPTIONS
Access-Control-Allow-Headers: X-Requested-With,Content-Type
Date: Tue, 05 Jan 2016 17:57:44 GMT
Content-Length: 1565
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Service</title>
<style>BODY { color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top: 0px; } #content { margin-left: 30px; font-size: .70em; padding-bottom: 2em; } A:link { color: #336699; font-weight: bold; text-decoration: underline; } A:visited { color: #6699cc; font-weight: bold; text-decoration: underline; } A:active { color: #336699; font-weight: bold; text-decoration: underline; } .heading1 { background-color: #003366; border-bottom: #336699 6px solid; color: #ffffff; font-family: Tahoma; font-size: 26px; font-weight: normal;margin: 0em 0em 10px -20px; padding-bottom: 8px; padding-left: 30px;padding-top: 16px;} pre { font-size:small; background-color: #e5e5cc; padding: 5px; font-family: Courier New; margin-top: 0px; border: 1px #f0f0e0 solid; white-space: pre-wrap; white-space: -pre-wrap; word-wrap: break-word; } table { border-collapse: collapse; border-spacing: 0px; font-family: Verdana;} table th { border-right: 2px white solid; border-bottom: 2px white solid; font-weight: bold; background-color: #cecf9c;} table td { border-right: 2px white solid; border-bottom: 2px white solid; background-color: #e5e5cc;}</style>
</head>
<body>
<div id="content">
<p class="heading1">Service</p>
<p>Method not allowed.</p>
</div>
</body>
</html>
REST service configuration are based on http://enable-cors.org/server_wcf.html and http://www.khalidabuhakmeh.com/rest-http-verbs-and-iis-express

This is not a valid HTTP GET request:
Access-Control-Request-Method: GET
Access-Control-Request-Headers: access-control-allow-origin, access-control-allow-methods
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Host: bhawesh-pc:8000
DNT: 1
Connection: Keep-Alive
Cache-Control: no-cache
Content-Length: 0
The first line of a GET request should be:
GET /wanted_resource HTTP/1.1
So, if the server looks at the requested method at the beginning of the header, it sees this:
Access-Control-...
and will return a 405 Method Not Allowed.
Also, with GET, no Content-Length header is needed. It is better to remove that line.

I resolved the problem by these guidelines :
Try to avoid preflight request more Information ( In my case , I removed custom headers from request.)
Do not set withCredentials property to true in client request if you have
set Access-Control-Allow-Origin : * on service.
But , this solves only GET request problem. In the POST , I was getting the same problem , but this solution worked like magic.

Related

Dont get access token

I am using Oauth2 to get the access token, i can get the code but when I am using postman to get the access token i get an status 403.
this is the url that i am using:
https://www.linkedin.com/oauth/V2/accesstoken?grant_type=authorization_code&code=AQSSeTJlPER2UXROrlcxnZu1233VFqSGpnbb3LbySelnmayljjpasMtsCGJkPOD-tXGl4U_P-7q-OUxZl9cIvwo1niVT4v9UxfkBk-i0b4ZhY_2rKugw-ZXCPbQrf9qlfj9TX2eraJzfykUT78I7M6HRB0NMz5iqlnOmPvE5Yf6S486OTomn5xI-E2fk-FA&client_id=86k52xk4123dza&client_secret=kaouvpg1212iJyrw&redirect_uri=https%3A%2F%2F/www.test.co%2
Response:
<html lang="en">
<head>
<title>Unauthorized</title>
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAlFJREFUeNqUU8tOFEEUPVVdNV3dPe8xYRBnjGhmBgKjKzCIiQvBoIaNbly5Z+PSv3Aj7DSiP2B0rwkLGVdGgxITSCRIJGSMEQWZR3eVt5sEFBgTb/dN1yvnnHtPNTPG4PqdHgCMXnPRSZrpSuH8vUJu4DE4rYHDGAZDX62BZttHqTiIayM3gGiXQsgYLEvATaqxU+dy1U13YXapXptpNHY8iwn8KyIAzm1KBdtRZWErpI5lEWTXp5Z/vHpZ3/wyKKwYGGOdAYwR0EZwoezTYApBEIObyELl/aE1/83cp40Pt5mxqCKrE4Ck+mVWKKcI5tA8BLEhRBKJLjez6a7MLq7XZtp+yyOawwCBtkiBVZDKzRk4NN7NQBMYPHiZDFhXY+p9ff7F961vVcnl4R5I2ykJ5XFN7Ab7Gc61VoipNBKF+PDyztu5lfrSLT/wIwCxq0CAGtXHZTzqR2jtwQiXONma6hHpj9sLT7YaPxfTXuZdBGA02Wi7FS48YiTfj+i2NhqtdhP5RC8mh2/Op7y0v6eAcWVLFT8D7kWX5S9mepp+C450MV6aWL1cGnvkxbwHtLW2B9AOkLeUd9KEDuh9fl/7CEj7YH5g+3r/lWfF9In7tPz6T4IIwBJOr1SJyIGQMZQbsh5P9uBq5VJtqHh2mo49pdw5WFoEwKWqWHacaWOjQXWGcifKo6vj5RGS6zykI587XeUIQDqJSmAp+lE4qt19W5P9o8+Lma5DcjsC8JiT607lMVkdqQ0Vyh3lHhmh52tfNy78ajXv0rgYzv8nfwswANuk+7sD/Q0aAAAAAElFTkSuQmCC">
<style>
html, body, pre {
margin: 0;
padding: 0;
font-family: Monaco, 'Lucida Console', monospace;
background: #ECECEC;
}
h1 {
margin: 0;
background: #333;
padding: 20px 45px;
color: #fff;
text-shadow: 1px 1px 1px rgba(0,0,0,.3);
border-bottom: 1px solid #111;
font-size: 28px;
}
It looks like you are making a GET request which results in the parameters being sent as query-string parameters, according to step 3 here: https://developer.linkedin.com/docs/oauth2
They expect you to make a POST request which would cause the parameters to be sent via form parameters.
If you are using postman click the GET icon next to your URL and change it to POST.
====EDIT=====
You should remove your client_id and client_secret from the code sample. This is very insecure and can allow someone to make requests to LinkedIn using your account.

SOAP web service returning html code on iOS 10

I am trying to use the SOAp web service in my code and its not working as expected. The same code works fine prior to iOS 10.
Has anybody faced the same issue?
My code looks like this:
NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:#"CFBundleShortVersionString"];
NSString *msg=[NSString stringWithFormat:#"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n"
"<soap:Body>\n"
"<GetConfiguration xmlns=\"http://example.com/webservices/\">\n"
"<app_version>%#</app_version>\n"
"</GetConfiguration>\n"
"</soap:Body>\n"
"</soap:Envelope>\n",version];
NSURL * getUrl=[NSURL URLWithString:GET_CONFIGURATION_URL];
[Logger Log:GET_CONFIGURATION_URL];
NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:getUrl];
NSString *msgLength=[NSString stringWithFormat:#"%lu",(unsigned long)[msg length]];
[theRequest addValue:#"application/json;charset=utf-8" forHTTPHeaderField:#"Content-Type"];
[theRequest addValue:#"http://example.com/webservices/GetConfiguration" forHTTPHeaderField:#"SOAPAction"];
[theRequest addValue:msgLength forHTTPHeaderField:#"Content-Length"];
[theRequest setHTTPMethod:#"GET"];
[theRequest setHTTPBody:[msg dataUsingEncoding:NSUTF8StringEncoding]];
NSError *error = nil;
NSURLResponse *theResponse =[[NSURLResponse alloc]init];
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];//I also used AFJSONResponseSerializer but no success.
NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:theRequest completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
if (error) {
NSLog(#"Error: %#", error);
} else {
NSLog(#"%# %#", response, responseObject);
}
}];
[dataTask resume];
And I get the response embedded in <html> ... </html> which is in fact the code from server.
I am unable to get rid of this error.
Edit, the response is as follows:
<html>
<head><link rel="alternate" type="text/xml" href="/webservices/AppWebService.asmx?disco" />
<style type="text/css">
BODY { color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top: 0px; }
#content { margin-left: 30px; font-size: .70em; padding-bottom: 2em; }
A:link { color: #336699; font-weight: bold; text-decoration: underline; }
A:visited { color: #6699cc; font-weight: bold; text-decoration: underline; }
A:active { color: #336699; font-weight: bold; text-decoration: underline; }
A:hover { color: cc3300; font-weight: bold; text-decoration: underline; }
P { color: #000000; margin-top: 0px; margin-bottom: 12px; font-family: Verdana; }
pre { background-color: #e5e5cc; padding: 5px; font-family: Courier New; font-size: x-small; margin-top: -5px; border: 1px #f0f0e0 solid; }
td { color: #000000; font-family: Verdana; font-size: .7em; }
h2 { font-size: 1.5em; font-weight: bold; margin-top: 25px; margin-bottom: 10px; border-top: 1px solid #003366; margin-left: -15px; color: #003366; }
h3 { font-size: 1.1em; color: #000000; margin-left: -15px; margin-top: 10px; margin-bottom: 10px; }
ul { margin-top: 10px; margin-left: 20px; }
ol { margin-top: 10px; margin-left: 20px; }
li { margin-top: 10px; color: #000000; }
font.value { color: darkblue; font: bold; }
font.key { color: darkgreen; font: bold; }
font.error { color: darkred; font: bold; }
.heading1 { color: #ffffff; font-family: Tahoma; font-size: 26px; font-weight: normal; background-color: #003366; margin-top: 0px; margin-bottom: 0px; margin-left: -30px; padding-top: 10px; padding-bottom: 3px; padding-left: 15px; width: 105%; }
.button { background-color: #dcdcdc; font-family: Verdana; font-size: 1em; border-top: #cccccc 1px solid; border-bottom: #666666 1px solid; border-left: #cccccc 1px solid; border-right: #666666 1px solid; }
.frmheader { color: #000000; background: #dcdcdc; font-family: Verdana; font-size: .7em; font-weight: normal; border-bottom: 1px solid #dcdcdc; padding-top: 2px; padding-bottom: 2px; }
.frmtext { font-family: Verdana; font-size: .7em; margin-top: 8px; margin-bottom: 0px; margin-left: 32px; }
.frmInput { font-family: Verdana; font-size: 1em; }
.intro { margin-left: -15px; }
</style>
<title>
WebService Web Service
</title></head>
<body>
<div id="content">
<p class="heading1">WebService</p><br>
<span>
<p class="intro">Click here for a complete list of operations.</p>
<h2>GetConfiguration</h2>
<p class="intro"></p>
<h3>Test</h3>
The test form is only available for requests from the local machine.
<span>
<h3>SOAP 1.1</h3>
<p>The following is a sample SOAP 1.1 request and response. The <font class=value>placeholders</font> shown need to be replaced with actual values.</p>
<pre>POST /webservices/AppWebService.asmx HTTP/1.1
Host: MY_HOST_URL_HERE
Content-Type: text/xml; charset=utf-8
Content-Length: <font class=value>length</font>
SOAPAction: "http://example.com/webservices/GetConfiguration"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetConfiguration xmlns="http://example.com/webservices/">
<app_version><font class=value>string</font></app_version>
</GetConfiguration>
</soap:Body>
</soap:Envelope></pre>
<pre>HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: <font class=value>length</font>
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetConfigurationResponse xmlns="http://example.com/webservices/">
<GetConfigurationResult><font class=value>string</font></GetConfigurationResult>
</GetConfigurationResponse>
</soap:Body>
</soap:Envelope></pre>
</span>
<span>
<h3>SOAP 1.2</h3>
<p>The following is a sample SOAP 1.2 request and response. The <font class=value>placeholders</font> shown need to be replaced with actual values.</p>
<pre>POST /webservices/AppWebService.asmx HTTP/1.1
Host: MY_HOST_URL_HERE
Content-Type: application/soap+xml; charset=utf-8
Content-Length: <font class=value>length</font>
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetConfiguration xmlns="http://example.com/webservices/">
<app_version><font class=value>string</font></app_version>
</GetConfiguration>
</soap12:Body>
</soap12:Envelope></pre>
<pre>HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: <font class=value>length</font>
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetConfigurationResponse xmlns="http://example.com/webservices/">
<GetConfigurationResult><font class=value>string</font></GetConfigurationResult>
</GetConfigurationResponse>
</soap12:Body>
</soap12:Envelope></pre>
</span>
</span>
</body>
</html>

How to check or ensure that client side cached images are rendered on android app on subsequent requests?

Our server returns ads to the publisher's app (android/iOS apps). Let's consider this case where the returned ad is an HTML with img tags containing remote images (resources stored in third party servers of ad networks). Something like this -
<!DO CTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Untitled Document</title>
<style> #ad{ margin: 0px auto 0 auto; width: 308px; padding: 5px; height: 38px; border: 1px solid #ddd; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; background-color:#fff; text-align:left; } #ad h3{ padding: 0; margin: 0; color:#0067FF; font-weight: normal; font-size: 12px; } #ad a { color:#009C00; font-size: 10px; text-decoration:none; margin: 0; padding: 0; } #ad p.description { margin: 0; padding: 0; font-size: 8px; margin-bottom: 10px; } .ad_label{ margin: 0 auto 0 auto; text-align: center; color: #a09f9f; font-size: 12px; padding: 3px 0 0 0; } </style>
</head>
<body>
<div id="ad">
<h3>Junk-A-Car</h3>
yp.com/reviews
<p class="description">Find Local Automobile Salvage Need Help? Click Here!</p>
</div>
<img src="http://imp.admarketplace.net/imp?id=7R7wxEzkiFdwxr3NJGbzfQbX4BkW4BkXfYbW1C\WfQ\W4p\W4pH+7RcdIG7+GmwqgClkfZldfQ8XfQ2Xfp2XfpbW4Z8nxnEZGmzYI=EYgCbnHF3QJre+GmwqgClrfpf+fCDW7ncQHmzdJR3KiF2zfQld4C2nimE+jmzYIczvIpkY4Zq+fp8Yfp2nxr7kgCbnxGEwxRwKj=EYJCdQHG7Z7nckxZkX1CbZfQxZ1pHnHncZIEzQx=fzfBaafpbnHF4kjFcTGm4WHZkX5QLWftInIFEqGr4wxRIwxQdw5GNuJtkkfBIdxr7KImEVGmwqgGTOxY8PfCDX5t7Q8Q\kfZ2T8n4V8Q\Y5t7q8Q\dfplT8R\O1QlXfQfrKBIWjF7KiF2zfCb+4Q2nHnwqI=EYGmwqgCby" width="1" height="1" />
</body>
</html>
<img src="http://54.204.70.10/fam/view.php?p=__pid=4e17aeb00411789d__sid=102175__bid=1259380__cb=e56d08f1c9__h=1431522124__acp=800660a03aab58e96ec93211c5fc5db6__s=f398b7b975fb896b27fed55d213f6687" alt="" width="1" height="1" />
Questions
Do the images resources get cached, by default, on client side and the same get rendered on subsequent ad requests? If not, can it be enforced from server side, by passing "necessary" headers?
I tried testing with fiddler, and always observed "200 Ok" status being displayed for same images.
How do I know when a cached image is loaded?
Updates
Updated ad response format - HTML format.
The server generatng the HTTP protocol response is responsible for sending cache control headers along with it indicating whether it is permitted to be cached and if so whether the server needs to be informed before each use.
This blog begginners guide is a good place to start for details. Then move on to the RFC 7234 caching specification itself

Are Safari & Mobile Safari rendering rounded borders with radius and padding incorrectly?

Safari and Mobile Safari seem to have a problem when you combine border radius, padding and borders. Works fine in Chrome and Firefox.
<-- Expected
<-- Safari Rendering
HTML:
<img src="http://lorempixel.com/200/200/animals/3/" />
CSS:
img {
width: 200px;
height: 200px;
-webkit-border-radius: 500px;
-moz-border-radius: 500px;
border-radius: 500px;
padding: 3px;
border: 1px solid #999;
margin: 10px
}
Example: http://jsfiddle.net/ucNwx/2/
Is it my fault or Safaris? How would I fix it?
My bet it's Safari bug: border-radius is applied late and produces clipping effect. Fortunately, box-shadow is rendered correctly, so let's use it:
border-radius: 50%;
box-shadow:
0 0 0 3px white,
0 0 0 4px #999;
Works on Safari 6 on iPad and OS X.
Best solution I can think of right now: http://jsfiddle.net/ucNwx/5/
Uses a wrapper div to draw the border and then places the image inside of it. Still got some artifacts on the right edge but I guess that's a Safari bug.
HTML
<div class="border-container">
<img src="http://lorempixel.com/200/200/animals/3/" />
</div>
CSS
.border-container {
width: 206px;
height: 206px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
border: 1px solid #999;
margin: 10px
}
img {
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
width: 200px;
height: 200px;
margin: 3px;
}

WCF Rest service POST method fails in Fiddler

I'm using WCF Restservice to authenticate user. I have a POST method and works fine using jquery but fails on Fiddler test. I get 415 Unsupported Media Type.
Here is my code
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "Login", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
public string Login(string userName, string password)
{
string valid;
// Log in user
int authenticatedId = AuthenticateManager.Authenticate(userName, password);
if (authenticatedId != -1)
{
valid = "Welcome " + userName + "!";
}
else
{
valid = "Login failed!";
}
return valid;
}
This is what I'm passing in Fiddler body
[{ "userName":"dusshyi",
"password":"subram1" }]
This is what fiddler generating
<HTML><HEAD><STYLE type="text/css">#content{ FONT-SIZE: 0.7em; PADDING-BOTTOM: 2em; MARGIN-LEFT: 30px}BODY{MARGIN-TOP: 0px; MARGIN-LEFT: 0px; COLOR: #000000; FONT-FAMILY: Verdana; BACKGROUND-COLOR: white}P{MARGIN-TOP: 0px; MARGIN-BOTTOM: 12px; COLOR: #000000; FONT-FAMILY: Verdana}PRE{BORDER-RIGHT: #f0f0e0 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #f0f0e0 1px solid; MARGIN-TOP: -5px; PADDING-LEFT: 5px; FONT-SIZE: 1.2em; PADDING-BOTTOM: 5px; BORDER-LEFT: #f0f0e0 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #f0f0e0 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e5e5cc}.heading1{MARGIN-TOP: 0px; PADDING-LEFT: 15px; FONT-WEIGHT: normal; FONT-SIZE: 26px; MARGIN-BOTTOM: 0px; PADDING-BOTTOM: 3px; MARGIN-LEFT: -30px; WIDTH: 100%; COLOR: #ffffff; PADDING-TOP: 10px; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #003366}.intro{MARGIN-LEFT: -15px}</STYLE>
<TITLE>Service</TITLE></HEAD><BODY>
<DIV id="content">
<P class="heading1">Service</P>
<BR/>
<P class="intro">Endpoint not found.</P>
</DIV>
</BODY></HTML>
Please help!
Have you set the Content-Type of the request to application/json in Fiddler's Request body editor?
I had the same problem this morning...
What fixed it for me was to click on the "Composer" tab, then add the following to the "Request Headers" section:
Content-Type: application/x-www-form-urlencoded
Without this line, I noted that the log showed it was attempting to call my REST Service with a Content-Type of "text/html", and the Service wouldn't get called.
This would even happen if I added the line:
Content-Type: application/json
However, after adding the line "Content-Type: application/x-www-form-urlencoded", Fiddler would now call the service with a Content Type of "application/json", and the web service was called correctly. Strange...
I've created a complete walkthough of creating a JSON WCF Web Service, and testing it with Fiddler, on the following page:
http://mikesknowledgebase.com/pages/Services/WebServices-Page1.htm
Fiddler Web Debugger:Composer section; settings
Parsed
POST,../Service.svc/Login,HTTP/1.1
Request Header:
User-Agent: Fiddler
Content-Type: application/json;charset=UTF-8
Host: localhost:15021
Content-Length: 43
Request Body:
{"username":"ABC","password":"pwd"}
and then execute