# Help Rest api working with curl but giving hard time in c#

**URL:** <https://community.dreamfactory.com/t/help-rest-api-working-with-curl-but-giving-hard-time-in-c/875>\
**Category:** REST API\
**Created:** [February 23, 2015, 3:52pm UTC](https://community.dreamfactory.com/t/help-rest-api-working-with-curl-but-giving-hard-time-in-c/875 "2015-02-23T15:52:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ikyaqoob](https://avatars.discourse-cdn.com/v4/letter/i/9dc877/32.png) [@ikyaqoob](https://community.dreamfactory.com/u/ikyaqoob)\
**Post date:** [February 23, 2015, 3:52pm UTC](https://community.dreamfactory.com/t/help-rest-api-working-with-curl-but-giving-hard-time-in-c/875/1 "2015-02-23T15:52:45Z")

</div>

Hi we are trying to use DF for creating user accounts as follows

curl -X POST [http://url/rest/system/user/](http://url/rest/system/user/) -H ‘X-DreamFactory-Application-Name: admin’ -H ‘X-DreamFactory-Session-Token: dfa1a625efa935c5dc780d4bf925db15’ -d ‘{ “display\_name”:“Joe Smith”,“first\_name”:“Joe”, “last\_name”:“Smith”, “email”:"joe.smith@acme.com", “phone”:“555-666-7777”, “is\_active”:true, “is\_sys\_admin”:false, “role\_id”:2, “password”:“password” }’

it works perfectly same is the case when using POSTMAN web client

but when trying to use it in c# Dotnet 4.5  
it is not working , i know technically it’s not Dream Factory rather c# shortcoming  
can someone please help me out with this

thanks

---

<div class="post-metadata">

**Author:** ![ikyaqoob](https://avatars.discourse-cdn.com/v4/letter/i/9dc877/32.png) [@ikyaqoob](https://community.dreamfactory.com/u/ikyaqoob)\
**Post date:** [March 1, 2015, 3:19am UTC](https://community.dreamfactory.com/t/help-rest-api-working-with-curl-but-giving-hard-time-in-c/875/2 "2015-03-01T03:19:34Z")

</div>

ok i cracked it ,

using [unirest.io](http://unirest.io) as recommended by DF team

HttpResponse myClass = Unirest.post(“[http://httpbin.org/post](http://httpbin.org/post)”)  
.header(“accept”, “application/json”)  
.body("{“parameter”:“value”, “foo”:“bar”}")  
.asJson();

using above replacing with

and formating record structure which is {“record”:[{“0”:“bobthebuilder@norbiton@2”}]}  
as @{"“record”":[{"“0"”:"“bobthebuilder@norbiton@2"”}]}

makes it works

thanks

---

<div class="post-metadata">

**Author:** ![Rudy\_Hinojosa](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/rudy_hinojosa/32/1140_2.png) [@Rudy\_Hinojosa](https://community.dreamfactory.com/u/Rudy_Hinojosa)\
**Post date:** [March 9, 2016, 5:10pm UTC](https://community.dreamfactory.com/t/help-rest-api-working-with-curl-but-giving-hard-time-in-c/875/3 "2016-03-09T17:10:41Z")

</div>

even cleaner:

string obj = “{ “email”: "somebloke@email.com”, “password”: “iforgot”, “duration”: 0 }";  
var o = Newtonsoft.Json.JsonConvert.DeserializeObject\< dynamic \>(obj);

…then you can do:

.body(o).asJson();

---

<div class="post-metadata">

**Author:** ![Rudy\_Hinojosa](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/rudy_hinojosa/32/1140_2.png) [@Rudy\_Hinojosa](https://community.dreamfactory.com/u/Rudy_Hinojosa)\
**Post date:** [April 8, 2018, 2:46pm UTC](https://community.dreamfactory.com/t/help-rest-api-working-with-curl-but-giving-hard-time-in-c/875/4 "2018-04-08T14:46:06Z")

</div>

Have you tried using the Nuget Package DreamFactory? You can pull it straight from Visual Studio. If you need help with usage, drop me a line
