Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Can't get rid of escape character in string

json string http

  • Please log in to reply
1 reply to this topic

#1 scoleman2272

scoleman2272

    New Member

  • Members
  • Pip
  • 1 posts

Posted 09 January 2013 - 07:18 PM

I'm trying to build a JSON string to send via the HTTP_Client to a Linux server. The problem is that the JSON parameters need to be double quoted. The only way to get a double quote into a c# string is to use the escape character. The problem is that when the string is received by the Linux server it still contains the escape characters which confuses it.

 

Example, 

string t1 = "[{"TS"}]"

HTTP_Client.HTTP_Response Response = httpClient.Post(t1);

 

When this is received by the Linux server it still has the escape character is tact:   [{"TS"}]

 

I haven't been able to figure out how to get rid of the escape character.

 

 



#2 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 09 January 2013 - 07:05 AM

Hi scoleman and welcome to the netduino forums!

 

Could this also be a setting on the server side? I know PHP used to have a magic_quotes_gpc setting that escapes data that is posted.


"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.