You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by sam lee <sk...@gmail.com> on 2010/12/10 17:34:39 UTC

how do I set multi-value property with only one value using SlingPostServlet?

I tried:

curl -u admin:admin -F'foo=bar' -F'foo=' http://localhost:8888/some/path

but this creates property foo to be {bar,}  (second element is empty).

I also tried

curl -u admin:admin -F'foo=bar' -F'foo=null' http://localhost:8888/some/path

but still it failed to create a multi-value property where only one value is
initialized.

Re: how do I set multi-value property with only one value using SlingPostServlet?

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Fri, Dec 10, 2010 at 5:41 PM, sam lee <sk...@gmail.com> wrote:
> curl -u admin:admin -F'foo=bar' -F'foo@TypeHint=String[]'
> http://localhost:8888/some/path
>
> worked.

Thanks for this, I have added it to the FAQ at
https://cwiki.apache.org/confluence/display/SLING/FAQ#FAQ-HowtoIcreateamultivaluepropertywithasinglevalue%2CinHTTP%3F

-Bertrand

Re: how do I set multi-value property with only one value using SlingPostServlet?

Posted by sam lee <sk...@gmail.com>.
curl -u admin:admin -F'foo=bar' -F'foo@TypeHint=String[]'
http://localhost:8888/some/path

worked.

Thaks./

On Fri, Dec 10, 2010 at 11:34 AM, sam lee <sk...@gmail.com> wrote:

> I tried:
>
> curl -u admin:admin -F'foo=bar' -F'foo=' http://localhost:8888/some/path
>
> but this creates property foo to be {bar,}  (second element is empty).
>
> I also tried
>
> curl -u admin:admin -F'foo=bar' -F'foo=null'
> http://localhost:8888/some/path
>
> but still it failed to create a multi-value property where only one value
> is initialized.
>
>
>
>