打印信息

This commit is contained in:
cxt 2019-07-27 16:38:20 +08:00
parent c24ae86a6f
commit 6a53d93537
1 changed files with 4 additions and 3 deletions

View File

@ -612,7 +612,7 @@ module ProjectsHelper
"projects": [ "projects": [
{ {
"source": { "source": {
"location": "https://github.com/looly/hutool.git", "location": "http://git.trustie.net/hudongyang/che_test.git",
"type": "git", "type": "git",
"parameters": {} "parameters": {}
}, },
@ -652,7 +652,7 @@ module ProjectsHelper
} }
], ],
"defaultEnv": "default", "defaultEnv": "default",
"name": "create-from-api", "name": "test_for_trustie",
"links": [] "links": []
} }
@ -666,7 +666,8 @@ module ProjectsHelper
request.body = params.to_json request.body = params.to_json
request['Content-Type'] = 'application/json;charset=utf-8' request['Content-Type'] = 'application/json;charset=utf-8'
response = http.start { |http| http.request(request) } response = http.start { |http| http.request(request) }
ActiveSupport::JSON.decode(response.body) response = ActiveSupport::JSON.decode(response.body)
Rails.logger.info("#############response: #{response}")
rescue =>err rescue =>err
Rails.logger.error("#############send_error: #{err.message}") Rails.logger.error("#############send_error: #{err.message}")
return nil return nil