0

JasperReports Serverレスト ユーザー サービス APIで新しいユーザーを作成しようとしています。

しかし、私はいつも 400 の悪いリクエストを受け取ります。誰かが私が間違っていることを指摘できますか?

curl -i -u jasperadmin:jasperadmin -H "Content-Type: application/json" -H "Accept: application/json" -X PUT -d '{\"username\":\"mynewuser\",\"password\":\"mynewuser\",\"fullName\":\"NEWUSER\":\"emailAddress:\"user_1@test.com\"}' "http://localhost:8080/jasperserver/rest/user/"

HTTP/1.1 400 Bad Request
Server: Apache-Coyote/1.1
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 05:30:00 GMT+05:30
P3P: CP="ALL"
Set-Cookie: JSESSIONID=F7394A9F7348C22E4B264FBCEB6B828F; Path=/jasperserver
Content-Type: text/html;charset=UTF-8
Content-Length: 971
Date: Mon, 02 Sep 2013 10:32:21 GMT
Connection: close
4

1 に答える 1

0

この問題が発生したのは、誤って、使用していた Jasper Server のバージョンと一致しない古い jasper Web サービス ドキュメントを参照していたためです。私の愚かな間違い。

参考までに、正しい URL は次のようになります。http://example.com/jasperserver/rest_v2/organizations/organization_id/users/<new_user_id>

私はジャスパーサーバーの商用版を使用していたので、リクエストURLにorganisation_idを含める必要があります。

于 2013-09-03T05:10:36.330 に答える