     if method in ["POST", "PUT"]
       if typeof(body) isnt "string"
         body = JSON.stringify body
-
-      options.headers["Content-Length"] = body.length
+      options.body = body
+      # options.headers["Content-Length"] = body.length
 
     # console.log options.url
     request options, (err, response, data) ->
       if !err and response?.statusCode is 200
+        parsedData = data
         try
-          if opt.type is 'json'
-            callback null, JSON.parse(data), response
-          else if opt.type is 'atom'
-            rssparser.parseString data, {}, (error, feed) ->
-              # console.log feed
-              callback error, feed, response
-        catch err2
-          callback null, (data or { }), response
+          parsedData = JSON.parse(data)
+
+        if opt.type is 'json'
+          callback null, (parsedData or { }), response
+        else if opt.type is 'atom'
+          rssparser.parseString data, {}, (error, feed) ->
+            # console.log feed
+            callback error, feed, response
       else
-        console.log 'error: ' + response?.statusCode + ', url =>' + options.url
+        console.log 'code: ' + response?.statusCode + ', url =>' + options.url
         console.log err ||= response?.statusCode
-        #@send "Redmine がなんかエラーやわ"
-        callback err, null, response
+        callback err, data, response
   # /private request }}}
 # /Redmine }}}
 

      msg.send reply
  # }}}

#    userName = msg.match[1].toLowerCase()
#    user = whoIsThis robot, userName
#
#    redmine.Users name:user, (err, data) ->
#      # console.log 'count:' + userName + ' ' + data.total_count
#      unless data.total_count > 0
#        msg.reply "\"#{userName}\" が redmine で見つけられない"
#        return false
#
#      user = resolveUsers(user, data.users)[0]
#      console.log user


      continue
    break
  return date
# }}}

getActivityId = (activity) -> # {{{
  return 8 if activity.match /要件定義/
  return 9 if activity.match /製造/
  return 10 if activity.match /管理/
  return 11 if activity.match /結テ仕/
  return 12 if activity.match /調査/
  return 13 if activity.match /見積/
  return 14 if activity.match /リリース/
  return 15 if activity.match /ヒアリング/
  return 16 if activity.match /開発環境/
  return 17 if activity.match /オペマニ/
  return 18 if activity.match /営業/
  return 24 if activity.match /社内手続き/
  return 25 if activity.match /現状分析/
  return 26 if activity.match /教育/
  return 27 if activity.match /社内環境/
  return 28 if activity.match /業務外作業/
  return 29 if activity.match /引継/
  return 30 if activity.match /土曜出勤/
  return 31 if activity.match /提案活動/
  return 32 if activity.match /単テ仕/
  return 33 if activity.match /単テ実/
  return 34 if activity.match /基本設計/
  return 35 if activity.match /詳細設計/
  return 37 if activity.match /結テ実/
  return 38 if activity.match /PMO/
  return 39 if activity.match /ユーザー環境/
  return null
# }}}

# tries to resolve ambiguous users by matching login or firstname# {{{
