# Problème with REST API call and space characters

**URL:** <https://community.dreamfactory.com/t/probleme-with-rest-api-call-and-space-characters/4208>\
**Category:** REST API\
**Tags:** rest\
**Created:** [December 12, 2017, 5:41pm UTC](https://community.dreamfactory.com/t/probleme-with-rest-api-call-and-space-characters/4208 "2017-12-12T17:41:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Victoria\_Dimitrova](https://avatars.discourse-cdn.com/v4/letter/v/91b2a8/32.png) [@Victoria\_Dimitrova](https://community.dreamfactory.com/u/Victoria_Dimitrova)\
**Post date:** [December 12, 2017, 5:41pm UTC](https://community.dreamfactory.com/t/probleme-with-rest-api-call-and-space-characters/4208/1 "2017-12-12T17:41:30Z")

</div>

Hi,  
Currently I have a problem with Dream Factory REST API call when a **space** is present into the API URL call.  
I have a get request with a sort parameter that must to be send for SOLR server. This space I don’t know how it is converted, but it seems to arrive into not appropriate mananer.

curl -X GET   
‘[http://localhosts:81/api/v2/test/list/test?rows=10&sort=random\_test%20desc](http://localhosts:81/api/v2/test/list/test?rows=10&sort=random_test%20desc)’   
-H ‘X-DreamFactory-Api-Key: e115f92d18ba58e9a29389’   
-H ‘X-DreamFactory-Session-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1’

Is it a Dream factory problem and is there a manner to surround this problem ?

Thanks

---

<div class="post-metadata">

**Author:** ![Victoria\_Dimitrova](https://avatars.discourse-cdn.com/v4/letter/v/91b2a8/32.png) [@Victoria\_Dimitrova](https://community.dreamfactory.com/u/Victoria_Dimitrova)\
**Post date:** [December 12, 2017, 9:29pm UTC](https://community.dreamfactory.com/t/probleme-with-rest-api-call-and-space-characters/4208/2 "2017-12-12T21:29:20Z")

</div>

Maybe I should use + character instead of %20?

---

<div class="post-metadata">

**Author:** ![Victoria\_Dimitrova](https://avatars.discourse-cdn.com/v4/letter/v/91b2a8/32.png) [@Victoria\_Dimitrova](https://community.dreamfactory.com/u/Victoria_Dimitrova)\
**Post date:** [December 19, 2017, 8:37am UTC](https://community.dreamfactory.com/t/probleme-with-rest-api-call-and-space-characters/4208/3 "2017-12-19T08:37:57Z")

</div>

Finaly the solution that I found is to change the curl call in order to make POST request and to put the parameters with spaces into the -d parameter.

Here is the call that work for our case :

> curl -X POST   
> ‘[http://localhost:81/api/v2/test/list/test?rows=10](http://localhost:81/api/v2/test/list/test?rows=10)’   
> -H ‘X-DreamFactory-Api-Key: e115f92d18ba58e9a2’   
> -H ‘X-DreamFactory-Session-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJz’   
> -d ‘sort=random\_test+DESC&fq=NAME:_ov_+OR+NAME:_a_’
