How to specify multipart HTML code so it's downloaded with 1 GET request - mime

I want to render a web page using content type Multipart, but my sniffer logs always show multiple GET requests for the images on the web page.
Here is my test code:
<!DOCTYPE html>
<html>
<head>
<title>multipart/form-data</title>
<header><h2>Testing multipart/form-data</h2></header>
<META HTTP-EQUIV="Content-Type" CONTENT="multipart/related; charset=ISO-8859-1"/>
</head>
<body>
Text outside the <form> tag.
<form
enctype="multipart/form-data"
method="POST"
action="/php/showPostGet.php" > <!-- The enctype attribute can only be used if method="post". -->
Text inside the <form> tag.<br />
<input type="submit" value='TEST'/><br>
<form enctype="multipart/text/plain">
Name1: <input type="text" name="fname" value="ABC"><br>
Name2: <input type="text" name="lname" value="123"><br>
</form>
<br />
<img src="/images/arrow_left.jpg" alt="left">
<img src="/images/arrow_right.jpg" alt="right">
<img src="/images/arrow_up.jpg" alt="up">
<img src="/images/arrow_down.jpg" alt="down">
<br/>
</form>
</body>
<br/>
</html>
When I do a Refresh on this web page, I expect to see a single GET request, but i see multiple GET requests (one for the main page and one for ea image file).
like this:
7 10.738337 163.64.287.173 10.235.5.146 HTTP GET /mdg/HTML/FileUpload/Andy/multipart-form-data.html HTTP/1.1
9 10.739553 10.235.5.146 163.64.287.173 HTTP HTTP/1.1 200 OK (text/html)
Content-Type: text/html; charset=ISO-8859-1\r\n
<META HTTP-EQUIV="Content-Type" CONTENT="multipart/form-data; charset=ISO-8859-1"/>
17 12.945487 163.64.287.173 10.225.57.136 HTTP GET /images/arrow_left.jpg HTTP/1.1
19 12.946704 10.225.57.136 163.64.287.173 HTTP HTTP/1.1 200 OK (JPEG JFIF image)
Content-Type: image/jpeg\r\n
28 14.816313 163.64.287.173 10.225.57.136 HTTP GET /images/arrow_right.jpg HTTP/1.1
30 14.817529 10.225.57.136 163.64.287.173 HTTP HTTP/1.1 200 OK (JPEG JFIF image)
Content-Type: image/jpeg\r\n
41 17.196125 163.64.287.173 10.225.57.136 HTTP GET /images/arrow_up.jpg HTTP/1.1
43 17.197342 10.235.5.146 163.64.287.173 HTTP HTTP/1.1 200 OK (JPEG JFIF image)
Content-Type: image/jpeg\r\n
51 19.060141 163.64.287.173 10.225.57.136 HTTP GET /images/arrow_down.jpg HTTP/1.1
53 19.061358 10.225.57.136 163.64.287.173 HTTP HTTP/1.1 200 OK (JPEG JFIF image)
Content-Type: image/jpeg\r\n
I expected to see 1 get request followed by several OK/CONTINUATION messages (with 'boundary=' data).
Something like this (from another web site):
901 15:36:40.100491 10.277.7.10 72.253.197.19 HTTP GET /app/WT/default.aspx?vtbl=1&debugds=320&vzmw3=vzmw3 HTTP/1.1
903 15:36:40.317813 72.253.197.19 10.277.7.10 HTTP HTTP/1.1 200 OK
Content-Type: multipart/mixed; boundary=next.part.8412f441-e4ea-4554-8400-9a003df2f78f\r\n
Content-Type: multipart/mixed; boundary=next.part.8412f441-e4ea-4554-8400-9a003df2f78f\r\n
MIME Multipart Media Encapsulation, Type: multipart/mixed, Boundary: "next.part.8412f441-e4ea-4554-8400-9a003df2f78f"
First boundary: --next.part.8412f441-e4ea-4554-8400-9a003df2f78f\r\n
Content-Type: text/html; charset=utf-8\r\n
905 15:36:40.319315 63.64.187.229 97.253.137.46 HTTP HTTP/1.1 200 OK
Content-Type: multipart/mixed; boundary=next.part.8412f441-e4ea-4554-8400-9a003df2f78f\r\n
Content-Type: multipart/mixed; boundary=next.part.8412f441-e4ea-4554-8400-9a003df2f78f\r\n
906 15:36:40.320116 72.253.197.19 10.247.7.10 HTTP Continuation

You won't be able to do this in HTML. Content-Type: multipart/... is an HTTP header, whereas the HTML tag <meta http-equiv="content-type"> supports very limited values as defined here: http://www.w3.org/TR/html-markup/meta.http-equiv.content-type.html#meta.http-equiv.content-type
A specially formatted string providing a character encoding name. Value: The
following parts, in exactly the following order:
The literal string "text/html;".
Optionally, one or more space characters.
The literal string "charset=".
One of the following:
For documents in the HTML syntax: A character encoding name.
For documents in the XML syntax: Any case-insensitive match for the string "UTF-8".
In other words, since this is an HTML document, the only allowed content-type is "text/html".
You want to specify "multipart/mixed" in the HTTP headers on the server side (e.g. using PHP header() or similar). But even then, it looks like the only browsers that support it are/were Firefox/Netscape; see How to download multiple files with one HTTP request?

Related

multiparts email in shell script

I have a problem with sending emails consisting of text/plain and text/html parts.
--AlternativeBoundaryString
Content-Type: text/plain;
Content-ID: <email.text/plain>
TEXT email
After sending the message only the HTML part is visible.
If I remove the HTML part and leave only the text/plain then the text part is sent correctly.
The attachments are sent correctly.
I would like to be able to send emails consisting of two parts: html and text with attachments.
Thanks in advance for your suggestions.
function createMail
{
local EMAIL
EMAIL=${1}
cat > ${MAIL_FILE} << EOF
From: ${MAIL_FROM}
To: ${EMAIL}
Cc: ${TO_RECIPIENTS_CC}
Bcc: ${TO_RECIPIENTS_BCC}
Subject: =?UTF-8?Q?${SUBJECT}?=
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="MixedBoundaryString"
--MixedBoundaryString
Content-Type: multipart/related; boundary="RelatedBoundaryString"
--RelatedBoundaryString
Content-Type: multipart/alternative; boundary="AlternativeBoundaryString"
--AlternativeBoundaryString
Content-Type: text/plain;
Content-ID: <email.text/plain>
**TEXT email**
--AlternativeBoundaryString
Content-Type: text/html;
Content-ID: <email.text/html>
<html>
<head>
</head>
<body>
<h1>Result</h1>
<p>HTML email</p>
<p><img border=0 width=1024 height=503 style='width:10.6666in;height:5.2416in' id=id.obrazek1 src="cid:id.obrazek1" alt="Opis: cid:id.obrazek1"></p>
</body>
</html>
--AlternativeBoundaryString--
--RelatedBoundaryString
Content-Type: image/jpeg; name=$(basename 'picture_png.png')
Content-Transfer-Encoding: uuencode
Content-ID: <id.obrazek1>
Content-Disposition: inline; filename="picture_png.png"
$(python -c 'import sys,uu; uu.encode("picture_png.png", sys.stdout)')
--RelatedBoundaryString--
--MixedBoundaryString
Content-Type: text/plain; name=$(basename 'test_log.log')
Content-Transfer-Encoding: uuencode
Content-Disposition: attachment; filename="test_log.log"
$(uuencode test_log.log test_log.log )
--MixedBoundaryString
Content-Type: text/plain; name=$(basename 'test_pdf.pdf')
Content-Transfer-Encoding: uuencode
Content-Disposition: attachment; filename="test_pdf.pdf"
$(python -c 'import sys,uu; uu.encode("test_pdf.pdf", sys.stdout)')
--MixedBoundaryString
Content-Type: application/vnd.ms-excel; name=$(basename 'test_excel.xlsx')
Content-Transfer-Encoding: uuencode
Content-Disposition: attachment; filename="test_excel.xlsx"
$(python -c 'import sys,uu; uu.encode("test_excel.xlsx", sys.stdout)')
--MixedBoundaryString--
EOF
}
function sendMail
{
cat ${MAIL_FILE} | /usr/sbin/sendmail -t
}

AMP Form always showing submit-error, even on response code 200

I am using AMP form to send data to my Golang server. Even if I skip all handling of data sent and just write response with the code 200 as is said in AMP form reference, I still get shown the submit-error template.
This is my form (I skipped the fields because it would be too long)
<form action-xhr="/contactus" method="POST" class="contactForm" target="_top" custom-validation-reporting="show-all-on-submit" id="contactForm">
<fieldset>
<!-- divs with input and submit button -->
</fieldset>
<div submit-success>
<template type="amp-mustache">
Success!
</template>
</div>
<div submit-error>
<template type="amp-mustache">
Error!
</template>
</div>
</form>
And this is an example of server response:
HTTP/1.1 200 OK
Content-Encoding: gzip
Vary: Accept-Encoding
Date: Sun, 23 Sep 2018 21:48:15 GMT
Content-Length: 23
Content-Type: application/x-gzip
Could the problem be on server side?
I can't figure it out... Any idea is much appreciated
I feel embarrassed.
After a couple of days wondering and getting back to this issue, when I finally decide to post a question, an idea struck me right after I do it...
The problem is with header Content-type. It must be set to JSON:
Content-type: application/json
Make sure that you implement AMP CORS headers.
Refer: https://amp.dev/documentation/guides-and-tutorials/learn/amp-caches-and-cors/amp-cors-requests?referrer=ampproject.org
If requests are for your own origin (your domain and not amp cached servers) then you can set following headers-
if (req.headers['amp-same-origin'] === 'true') {
origin = req.query.__amp_source_origin;
sourceOrigin = origin;
}
res.set({
'Access-Control-Allow-Origin': origin,
'AMP-Access-Control-Allow-Source-Origin': sourceOrigin,
'Access-Control-Allow-Source-Origin': 'AMP-Access-Control-Allow-Source-Origin',
'Access-Control-Expose-Headers': 'Access-Control-Allow-Origin' + ', AMP-Access-Control-Allow-Source-Origin' + ', Access-Control-Allow-Source-Origin'
});

How RESTTemplate Supports for Multipart/mixed in consumption

The REST service provider returns a media type of multipart/mixed and it has several boundaries such as application/xml and octstream. Which HttpMessageConverter could be used to satisfy this scenario.
POST: someUrl
Content-Type: multipart/mixed
--edt7Tfrdusa7r3lNQc79vXuhIIMlatb7PQg7Vp
Content-Disposition: form-data; name="meta-data"
Content-Type: application/json; charset=UTF-8
Content-Transfer-Encoding: 8bit
{
"name": "value"
}
--edt7Tfrdusa7r3lNQc79vXuhIIMlatb7PQg7Vp
Content-Disposition: form-data; name="file-data"; filename="file.properties"
Content-Type: text/xml
Content-Transfer-Encoding: 8bit
... File Data ...
Thanks

Why does my multi part post request fail when sending from Marklogic instead of a browser form?

I am trying to send a multi part post request from my local Marklogic server using this xquery script:
xquery version "1.0-ml";
let $uri := "http://uri_to_service"
let $data :=
'------WebKitFormBoundaryq3PKI0zfbTv08rDu
Content-Disposition: form-data; name="projectId"
1DBC9DEE-6B5D-0001-D76C-13F516502B00
------WebKitFormBoundaryq3PKI0zfbTv08rDu
Content-Disposition: form-data; name="language"
de
------WebKitFormBoundaryq3PKI0zfbTv08rDu
Content-Disposition: form-data; name="file"; filename="test.txt"
Content-Type: text/plain
Das ist ein Test.
------WebKitFormBoundaryq3PKI0zfbTv08rDu
Content-Disposition: form-data; name="submit"
Submit
------WebKitFormBoundaryq3PKI0zfbTv08rDu--
'
let $options :=
<options xmlns="xdmp:http">
<authentication method="basic">
<username>abc</username>
<password>123</password>
</authentication>
<data>{$data}</data>
<headers>
<Connection>keep-alive</Connection>
<Cache-Control>max-age=0</Cache-Control>
<Accept>text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8</Accept>
<Origin>null</Origin>
<User-Agent>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36</User-Agent>
<Content-Type>multipart/form-data; boundary=----WebKitFormBoundaryq3PKI0zfbTv08rDu</Content-Type>
<Accept-Encoding>gzip,deflate,sdch</Accept-Encoding>
<Accept-Language>en-US,en;q=0.8,de;q=0.6</Accept-Language>
</headers>
</options>
return
xdmp:http-post($uri, $options)
In Wireshark I see the following outgoing request:
POST /api/extract HTTP/1.1
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: null
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryq3PKI0zfbTv08rDu
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,de;q=0.6
From: admin#marcos-macbook-pro.local
Host: some_service_uri
Content-Length: 509
Authorization: Basic some_basic_code
------WebKitFormBoundaryq3PKI0zfbTv08rDu
Content-Disposition: form-data; name="projectId"
1DBC9DEE-6B5D-0001-D76C-13F516502B00
------WebKitFormBoundaryq3PKI0zfbTv08rDu
Content-Disposition: form-data; name="language"
de
------WebKitFormBoundaryq3PKI0zfbTv08rDu
Content-Disposition: form-data; name="file"; filename="test.txt"
Content-Type: text/plain
Das ist ein Test.
------WebKitFormBoundaryq3PKI0zfbTv08rDu
Content-Disposition: form-data; name="submit"
Submit
------WebKitFormBoundaryq3PKI0zfbTv08rDu--
HTTP/1.1 400 Bad Request
Server: nginx/1.6.1
Date: Fri, 22 Aug 2014 14:18:47 GMT
Content-Type: text/html;charset=utf-8
Content-Length: 1246
Connection: keep-alive
Set-Cookie: JSESSIONID=B677A4E57DB4E8E8076EB4C9DD3E0AF4; Path=/extractor
<html><head><title>Apache Tomcat/6.0.36 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 400 - Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadException: Stream ended unexpectedly</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadException: Stream ended unexpectedly</u></p><p><b>description</b> <u>The request sent by the client was syntactically incorrect.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.36</h3></body></html>
As you can see, the request is failing for some reason.
Then I tried the same request from Chrome Browser with a small html form.
<html>
<head>
<title>Test Form</title>
</head>
<body>
<form action="service_uri" method="post" enctype="multipart/form-data">
<input type="text" name="projectId" value="1DBC9DEE-6B5D-0001-D76C-13F516502B00">
<input type="text" name="language" value="de">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
The browser asks me for username/password and everything goes fine.
In Wireshark I can see:
POST /api/extract HTTP/1.1
Host: some_service_uri
Connection: keep-alive
Content-Length: 527
Cache-Control: max-age=0
Authorization: Basic some_basic_code
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: null
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryq3PKI0zfbTv08rDu
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,de;q=0.6
Cookie: JSESSIONID=469591D4A83F24BB77547B6C235F25B7
------WebKitFormBoundaryq3PKI0zfbTv08rDu
Content-Disposition: form-data; name="projectId"
1DBC9DEE-6B5D-0001-D76C-13F516502B00
------WebKitFormBoundaryq3PKI0zfbTv08rDu
Content-Disposition: form-data; name="language"
de
------WebKitFormBoundaryq3PKI0zfbTv08rDu
Content-Disposition: form-data; name="file"; filename="test.txt"
Content-Type: text/plain
Das ist ein Test.
------WebKitFormBoundaryq3PKI0zfbTv08rDu
Content-Disposition: form-data; name="submit"
Submit
------WebKitFormBoundaryq3PKI0zfbTv08rDu--
HTTP/1.1 200 OK
Server: nginx/1.6.1
Date: Fri, 22 Aug 2014 13:38:04 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
80
{"text":"Das ist ein Test.\n","metadata":{},"document":{"freeTerms":[{"textValue":"test","score":100,"frequencyInDocument":1}]}}
0
Why is my request failing when send from Marklogic? Based on the outgoing request (captured by Wireshark) I can find no difference, except Content-Length.
What is happening? Or what could be the reason? Could encoding change the Content-Length?
The server error was Stream ended unexpectedly so content-length seems like a good candidate: 527 vs 509.
Rather than writing your own multipart code, have you tried this library? https://github.com/ableasdale/consultant-tools/blob/da92815e1322fe8e479ba2ba3741857670498c2a/src/main/resources/modules/example/lib-multipart-post.xqy
One key difference is that it uses https://docs.marklogic.com/xdmp:multipart-encode

Is it possible to change IIS 7.x default list of acceptable mime types to more than application/json?

I'm working on a set of REST services, and we intend to support both JSON as well as BSON, and possibly XML, as return types for any resource call that returns data. It was a no brainer to get application/json working, however when hosted in IIS 7.x, we are hitting a default 406 error from IIS itself that states only application/json is acceptable for our routes. It should be noted that our routes are all extension-less, such as:
http://localhost/SomeEntity/12345
We would prefer to serialize data according to the most preferred content type specified in the clients HTTP Accept header. If text/xml or application/xml is specified, we would send xml. If application/bson is specified, we would send BSON, etc. Ultimately, we would like to support any content type whatsoever, allowing use of protocol buffers or some other high speed serialization approach in the future if necessary.
Does anyone know why IIS 7 seems to hard code application/json as the only acceptable content type that can be returned by extensionless resource URL's?
I've dug into the Mime Types settings at both the server level, as well as each site level. I've added / mappings for the . extension, as well as .* extension. It does not seem possible to add a mapping for simply *. In all honesty, I can't even figure out exactly how IIS 7 is routing requests in the first place. The ExtensionlessUrlHandler-Integrated-4.0 does not seem to be how, since that does not allow PUT verbs through, yet PUT verbs work fine. I am not sure if it might be via a Module, such as the UrlRoutingModule-4.0. I'm at a total loss as to how ASP.NET MVC 3 routes are even handled by IIS 7, why they work, or where I might configure what content types are allowed for extensionless requests. I would prefer to allow /, rather than be limited to any explicit set of mime types, however if an explicit set is necessary, I'll happily do so if I can get this working.
Examples:
Request
GET http://some.host.com/Resource/1234 HTTP/1.1
Host: internalinterop-course-resources.ecollege-labs.com
Accept: application/json
GET http://some.host.com/Resource/1234 HTTP/1.1
Host: internalinterop-course-resources.ecollege-labs.com
Response
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 3.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 29 Feb 2012 23:34:38 GMT
Content-Length: ??
{"Message":"yadda yadda"}
Request
GET http://some.host.com/Resource/1234 HTTP/1.1
Host: internalinterop-course-resources.ecollege-labs.com
Accept: application/xml
Response
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>IIS 7.5 Detailed Error - 406.0 - Not Acceptable; Supported content types: , application/json</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;background:#CBE1EF;}
code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;}
.config_source code{font-size:.8em;color:#000000;}
pre{margin:0;font-size:1.4em;word-wrap:break-word;}
ul,ol{margin:10px 0 10px 40px;}
ul.first,ol.first{margin-top:5px;}
fieldset{padding:0 15px 10px 15px;}
.summary-container fieldset{padding-bottom:5px;margin-top:4px;}
legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;}
legend{color:#333333;padding:4px 15px 4px 10px;margin:4px 0 8px -12px;_margin-top:0px;
border-top:1px solid #EDEDED;border-left:1px solid #EDEDED;border-right:1px solid #969696;
border-bottom:1px solid #969696;background:#E7ECF0;font-weight:bold;font-size:1em;}
a:link,a:visited{color:#007EFF;font-weight:bold;}
a:hover{text-decoration:none;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.4em;margin:10px 0 0 0;color:#CC0000;}
h4{font-size:1.2em;margin:10px 0 5px 0;
}#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS",Verdana,sans-serif;
color:#FFF;background-color:#5C87B2;
}#content{margin:0 0 0 2%;position:relative;}
.summary-container,.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
.config_source{background:#fff5c4;}
.content-container p{margin:0 0 10px 0;
}#details-left{width:35%;float:left;margin-right:2%;
}#details-right{width:63%;float:left;overflow:hidden;
}#server_version{width:96%;_height:1px;min-height:1px;margin:0 0 5px 0;padding:11px 2% 8px 2%;color:#FFFFFF;
background-color:#5A7FA5;border-bottom:1px solid #C1CFDD;border-top:1px solid #4A6C8E;font-weight:normal;
font-size:1em;color:#FFF;text-align:right;
}#server_version p{margin:5px 0;}
table{margin:4px 0 4px 0;width:100%;border:none;}
td,th{vertical-align:top;padding:3px 0;text-align:left;font-weight:bold;border:none;}
th{width:30%;text-align:right;padding-right:2%;font-weight:normal;}
thead th{background-color:#ebebeb;width:25%;
}#details-right th{width:20%;}
table tr.alt td,table tr.alt th{background-color:#ebebeb;}
.highlight-code{color:#CC0000;font-weight:bold;font-style:italic;}
.clear{clear:both;}
.preferred{padding:0 5px 2px 5px;font-weight:normal;background:#006633;color:#FFF;font-size:.8em;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error in Application "some.host.com"</h1></div>
<div id="server_version"><p>Internet Information Services 7.5</p></div>
<div id="content">
<div class="content-container">
<fieldset><legend>Error Summary</legend>
<h2>HTTP Error 406.0 - Not Acceptable; Supported content types: , application/json</h2>
<h3>The resource cannot be displayed because the file extension is not being accepted by your browser.</h3>
</fieldset>
</div>
<div class="content-container">
<fieldset><legend>Detailed Error Information</legend>
<div id="details-left">
<table border="0" cellpadding="0" cellspacing="0">
<tr class="alt"><th>Module</th><td>ManagedPipelineHandler</td></tr>
<tr><th>Notification</th><td>ExecuteRequestHandler</td></tr>
<tr class="alt"><th>Handler</th><td>System.Web.Mvc.MvcHandler</td></tr>
<tr><th>Error Code</th><td>0x00000000</td></tr>
</table>
</div>
<div id="details-right">
<table border="0" cellpadding="0" cellspacing="0">
<tr class="alt"><th>Requested URL</th><td>http://some.host.com:80/Resource/1234</td></tr>
<tr><th>Physical Path</th><td>x:\inetpub\some.host.com\Resources\1234</td></tr>
<tr class="alt"><th>Logon Method</th><td>Anonymous</td></tr>
<tr><th>Logon User</th><td>Anonymous</td></tr>
</table>
<div class="clear"></div>
</div>
</fieldset>
</div>
<div class="content-container">
<fieldset><legend>Most likely causes:</legend>
<ul> <li>The request was rejected because it contained an Accept header for a MIME type that is not supported for the requested file extension.</li> </ul>
</fieldset>
</div>
<div class="content-container">
<fieldset><legend>Things you can try:</legend>
<ul> <li>Verify the MIME settings for the file extension that was requested to make sure this MIME type is acceptable.</li> </ul>
</fieldset>
</div>
<div class="content-container">
<fieldset><legend>Links and More Information</legend>
This error occurs when the client requests a file with a certain file extension and then specifies the Accept header with a MIME type that is different from the configuration of this file extension on the server. An example is requesting a file with the .doc extension and specifying an Accept header with text/xml instead of application/msword. Usually the client specifies */* for the Accept header, which allows the request to serve any MIME type.
<p>View more information ยป</p>
</fieldset>
</div>
</div>
</body>
</html>

Resources