TransWikia.com

Why curl returns "userName%" by GeoServer REST API create new user

Geographic Information Systems Asked on February 24, 2021

When I insert this below link like GeoServer 2.17.1 RESTful API I got only: userName%

curl -u admin:@dmin9901 -X POST http://localhost:8080/geoserver/rest/security/usergroup/users/ -H  "accept: application/json" -H  "content-type: application/json" -d "{  "userName": "test",  "password": "test1234",  "enabled": true}"

It can’t create new user in my GeoServer, it would be bug?

enter image description here

One Answer

Looking at the API docs it looks like the API endpoint you are hitting is incorrect.

GeoServer API

Based on this I would expect the call to be:

curl -u admin:@dmin9901 -X POST http://localhost:8080/geoserver/rest/usergroup/users/ -H  "accept: application/json" -H  "content-type: application/json" -d "{  "userName": "test",  "password": "test1234",  "enabled": true}"

If that is not the issue I'd look in the geoserver log file (by default it will be in $GEOSERVER_DATA_DIR/logs. As well as adding the -v option to the curl command to see what the response headers look like.

Answered by Andy C on February 24, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP