Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#503 closed defect (wontfix)

Incorrect content type in JsonService

Reported by: anonymous Owned by: alex
Priority: high Milestone:
Component: Core Version: 0.2
Keywords: Cc:
Blocked By: Blocking:


I used JsonService? but I got an empty input stream in my servlet. I used TCP monitor to see what's happening, I found that the content type was incorrect.

Here is the capture of TCP monitor:

POST /lnp/resources/pages/ HTTP/1.1 Host: localhost:8080 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20060111 Firefox/ Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q= 0.7 Keep-Alive: 300 Connection: keep-alive Content-Type: application/x-www-form-urlencoded Content-Length: 46 Pragma: no-cache Cache-Control: no-cache


I also found the root cause of this problem. The mimetype is not recognized by

I change one line to get it work for me, but it may not be good enough for dojo project. My change is in BrowserIO.js; The original line is: http.setRequestHeader("Content-Type", kwArgs.multipart ? ("multipart/form-data; boundary=" + this.multipartBoundary) : (kwArgs.contentType | | "application/x-www-form-urlencoded"));

My new line is: http.setRequestHeader("Content-Type", kwArgs.multipart ? ("multipart/form-data; boundary=" + this.multipartBoundary) : (kwArgs.contentType | | kwArgs.mimetype | | "application/x-www-form-urlencoded"));

if the core developers can review dojo code and use a consistent name for "contentType" or "mimetype".


Cliff Zhao

Change History (3)

comment:1 Changed 16 years ago by alex

Milestone: 0.2.2release0.3release
Owner: changed from anonymous to alex
Priority: highesthigh
severity: blockermajor
Status: newassigned

comment:2 Changed 16 years ago by sjmiles

Resolution: wontfix
Status: assignedclosed

The contentType argument is intended to describe the outgoing request. The mimeType argument is inteded to describe the incoming response.

It can be a confusing distinction, especially because at first it appears odd to have a response type defined at request time. However, trying to detect or guess the proper response type from headers is less robust.

comment:3 Changed 15 years ago by (none)

Milestone: 0.3release

Milestone 0.3release deleted

Note: See TracTickets for help on using tickets.