# Best approach to pass hash type data in string form from Rails/Ruby to a C# app?

**URL:** <https://www.ruby-forum.com/t/best-approach-to-pass-hash-type-data-in-string-form-from-rails-ruby-to-a-c-app/180827>\
**Category:** Rails\
**Created:** [December 30, 2009, 12:13am UTC](https://www.ruby-forum.com/t/best-approach-to-pass-hash-type-data-in-string-form-from-rails-ruby-to-a-c-app/180827 "2009-12-30T00:13:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![greghauptmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@greghauptmann](https://www.ruby-forum.com/u/greghauptmann)\
**Post date:** [December 30, 2009, 12:13am UTC](https://www.ruby-forum.com/t/best-approach-to-pass-hash-type-data-in-string-form-from-rails-ruby-to-a-c-app/180827/1 "2009-12-30T00:13:57Z")

</div>

Hi,

I need to pass (via string content of a HTTP request/response body)  
name value pairs of data (like a hash) back from a Ruby on Rails  
server to a C# client.

Anyone happen to know offhand what would be the best format to do this  
in? Probably XML I would guess?

tks

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

---

<div class="post-metadata">

**Author:** ![greghauptmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@greghauptmann](https://www.ruby-forum.com/u/greghauptmann)\
**Post date:** [December 30, 2009, 12:15am UTC](https://www.ruby-forum.com/t/best-approach-to-pass-hash-type-data-in-string-form-from-rails-ruby-to-a-c-app/180827/2 "2009-12-30T00:15:31Z")

</div>

greghauptmann wrote:

> Hi,
> 
> I need to pass (via string content of a HTTP request/response body)  
> name value pairs of data (like a hash) back from a Ruby on Rails  
> server to a C# client.
> 
> Anyone happen to know offhand what would be the best format to do this  
> in? Probably XML I would guess?

No, XML is a bit too heavy. I’d usually advise JSON or Yaml.

> tks
> 
> –
> 
> You received this message because you are subscribed to the Google  
> Groups “Ruby on Rails: Talk” group.  
> To post to this group, send email to removed\_email\_address@domain.invalid.  
> To unsubscribe from this group, send email to  
> removed\_email\_address@domain.invalid.  
> For more options, visit this group at  
> [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![greghauptmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@greghauptmann](https://www.ruby-forum.com/u/greghauptmann)\
**Post date:** [December 30, 2009, 12:19am UTC](https://www.ruby-forum.com/t/best-approach-to-pass-hash-type-data-in-string-form-from-rails-ruby-to-a-c-app/180827/3 "2009-12-30T00:19:49Z")

</div>

JSON might be better suited for key=\>value pairs… depends on your app  
i  
suppose. Also dont know about json support in C#, but it’s pretty much a  
web  
standard as far as i know…

On Wed, Dec 30, 2009 at 1:12 AM, greghauptmann  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> 

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

---

<div class="post-metadata">

**Author:** ![greghauptmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@greghauptmann](https://www.ruby-forum.com/u/greghauptmann)\
**Post date:** [December 30, 2009, 12:20am UTC](https://www.ruby-forum.com/t/best-approach-to-pass-hash-type-data-in-string-form-from-rails-ruby-to-a-c-app/180827/4 "2009-12-30T00:20:59Z")

</div>

do you know offhand then whether C# has a library to parse JSON or  
Yaml to C# variables?

On Dec 30, 9:15 am, Marnen Laibow-Koser [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> No, XML is a bit too heavy. I’d usually advise JSON or Yaml.
> 
> > To unsubscribe from this group, send email to  
> > removed\_email\_address@domain.invalid.  
> > For more options, visit this group at  
> > [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).
> 
> ## Best,
> 
> ## Marnen Laibow-Koserhttp://www.marnen.org removed\_email\_address@domain.invalid
> 
> Posted viahttp://www.ruby-forum.com/.

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

---

<div class="post-metadata">

**Author:** ![greghauptmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@greghauptmann](https://www.ruby-forum.com/u/greghauptmann)\
**Post date:** [December 30, 2009, 2:40am UTC](https://www.ruby-forum.com/t/best-approach-to-pass-hash-type-data-in-string-form-from-rails-ruby-to-a-c-app/180827/5 "2009-12-30T02:40:20Z")

</div>

json rocks

On Tue, Dec 29, 2009 at 4:12 PM, greghauptmann  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> –
> 
> You received this message because you are subscribed to the Google G. “Ruby on Rails: Talk” group.  
> To post to this group, send email to removed\_email\_address@domain.invalid.  
> To unsubscribe from this group, send email to removed\_email\_address@domain.invalid.  
> For more options, visit this group at [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

---

<div class="post-metadata">

**Author:** ![greghauptmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@greghauptmann](https://www.ruby-forum.com/u/greghauptmann)\
**Post date:** [December 30, 2009, 2:40am UTC](https://www.ruby-forum.com/t/best-approach-to-pass-hash-type-data-in-string-form-from-rails-ruby-to-a-c-app/180827/6 "2009-12-30T02:40:20Z")

</div>

[http://www.json.org/](http://www.json.org/)  
list at the bottom for languages

On Tue, Dec 29, 2009 at 4:17 PM, greghauptmann  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Marnen Laibow-Koserhttp://www.marnen.org

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

---

<div class="post-metadata">

**Author:** ![greghauptmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@greghauptmann](https://www.ruby-forum.com/u/greghauptmann)\
**Post date:** [December 30, 2009, 12:32am UTC](https://www.ruby-forum.com/t/best-approach-to-pass-hash-type-data-in-string-form-from-rails-ruby-to-a-c-app/180827/7 "2009-12-30T00:32:41Z")

</div>

greghauptmann wrote:

> do you know offhand then whether C# has a library to parse JSON or  
> Yaml to C# variables?

No, but the JSON and (I think) Yaml websites list a number of libraries  
for various languages. There’s almost certainly a JSON library at the  
very least.

> On Dec 30, 9:15ï¿½am, Marnen Laibow-Koser [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > No, XML is a bit too heavy. ï¿½I’d usually advise JSON or Yaml.
> > 
> > > To unsubscribe from this group, send email to  
> > > removed\_email\_address@domain.invalid.  
> > > For more options, visit this group at  
> > > [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).
> > 
> > ## Best,
> > 
> > ## Marnen Laibow-Koserhttp://www.marnen.org removed\_email\_address@domain.invalid
> > 
> > Posted viahttp://www.ruby-forum.com/.
> 
> –
> 
> You received this message because you are subscribed to the Google  
> Groups “Ruby on Rails: Talk” group.  
> To post to this group, send email to removed\_email\_address@domain.invalid.  
> To unsubscribe from this group, send email to  
> removed\_email\_address@domain.invalid.  
> For more options, visit this group at  
> [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

---

<div class="post-metadata">

**Author:** ![greghauptmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@greghauptmann](https://www.ruby-forum.com/u/greghauptmann)\
**Post date:** [December 30, 2009, 3:12am UTC](https://www.ruby-forum.com/t/best-approach-to-pass-hash-type-data-in-string-form-from-rails-ruby-to-a-c-app/180827/8 "2009-12-30T03:12:32Z")

</div>

On Tue, Dec 29, 2009 at 3:12 PM, greghauptmann  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> 

I would recommend JSON and you can find out what’s available at  
[json.org](http://json.org).

Good luck,

-Conrad

> 

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).
