Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-13064

Httpfs should return json instead of html when writting to a file without Content-Type

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • 3.0.0
    • None
    • httpfs
    • None

    Description

      When I create a hdfs file, I get the following response.

       

      zdh102:~ # curl -i -X PUT "http://10.43.183.103:14000/webhdfs/v1/2.txt?op=CREATE&user.name=hdfs&data=true"
      HTTP/1.1 400 Bad Request
      Server: Apache-Coyote/1.1
      Set-Cookie: hadoop.auth="u=hdfs&p=hdfs&t=simple&e=1516901333684&s=wYqDlu/ovRxay9d6I6UmoH77KKI="; Path=/; Expires= , 25- -2018 17:28:53 GMT; HttpOnly
      Content-Type: text/html;charset=utf-8
      Content-Language: en
      Content-Length: 1122
      Date: Thu, 25 Jan 2018 07:28:53 GMT
      Connection: close
      
      <html><head><title>Apache Tomcat/7.0.82 - 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 - Data upload requests must have content-type set to 'application/octet-stream'</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Data upload requests must have content-type set to 'application/octet-stream'</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/7.0.82</h3></body></html>zdh102:~ # 
      
      

       

       

      Attachments

        1. HDFS-13064.001.patch
          4 kB
          fang zhenyi
        2. HDFS-13064.002.patch
          4 kB
          fang zhenyi

        Activity

          People

            zhenyi fang zhenyi
            zhenyi fang zhenyi
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: