Click here to Skip to main content
14,392,818 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
GeneralRe: Woman Sets Up A Fake Art Gallery In London — And Actually Sells Her Paintings Pin
raddevus9-Oct-19 9:56
mvaraddevus9-Oct-19 9:56 
GeneralRe: Woman Sets Up A Fake Art Gallery In London — And Actually Sells Her Paintings Pin
PIEBALDconsult9-Oct-19 10:25
professionalPIEBALDconsult9-Oct-19 10:25 
GeneralRe: Woman Sets Up A Fake Art Gallery In London — And Actually Sells Her Paintings Pin
Rajesh R Subramanian9-Oct-19 14:54
professionalRajesh R Subramanian9-Oct-19 14:54 
PraiseRe: Woman Sets Up A Fake Art Gallery In London — And Actually Sells Her Paintings Pin
PeejayAdams9-Oct-19 23:32
MemberPeejayAdams9-Oct-19 23:32 
GeneralRe: Woman Sets Up A Fake Art Gallery In London — And Actually Sells Her Paintings Pin
Rajesh R Subramanian9-Oct-19 23:45
professionalRajesh R Subramanian9-Oct-19 23:45 
GeneralRe: Woman Sets Up A Fake Art Gallery In London — And Actually Sells Her Paintings Pin
Amarnath S9-Oct-19 17:59
professionalAmarnath S9-Oct-19 17:59 
GeneralRe: Woman Sets Up A Fake Art Gallery In London — And Actually Sells Her Paintings Pin
Ravi Bhavnani9-Oct-19 19:18
professionalRavi Bhavnani9-Oct-19 19:18 
GeneralOk, this is totally bizarre Pin
Marc Clifton9-Oct-19 5:57
mvaMarc Clifton9-Oct-19 5:57 
Using a code example from the third party website, I've been testing an API endpoint call using RestClient. Mind you, this is their code example (much reduced):

string json = "[some JSON]";
request.AddJsonBody(json);
client.Execute(request)

This works fine in a WinForm and Console application, but I kept getting a "content formatting error" from their server when I tried the exact same code in my WCF Service Application running under IIS. According to their devs, the JSON was coming in as an escaped string. But as I said, this only happens when testing the same code in my WCF Service.

Ironically, the solution was to add an object, not a string, to AddJsonBody:

var config = new Config();
... do some setup stuff ...
request.AddJsonBody(config);
client.Execute(request);

Now that works great on WinForm, Console, and the WCF Service App.

So the question still remains, what is IIS/WCF doing, or is it RestClient, that is creating an escaped JSON string? Or is it some bug on the third-party's server when it receives the call from another "server"?

I have no idea, I'm not asking a programming question or looking for an answer, I just wanted to share this with you all so if you encounter something goofy like this in the future, this might help.

GeneralRe: Ok, this is totally bizarre Pin
PIEBALDconsult9-Oct-19 5:59
professionalPIEBALDconsult9-Oct-19 5:59 
GeneralRe: Ok, this is totally bizarre Pin
Marc Clifton9-Oct-19 6:02
mvaMarc Clifton9-Oct-19 6:02 
GeneralRe: Ok, this is totally bizarre Pin
Shameel9-Oct-19 6:19
professionalShameel9-Oct-19 6:19 
GeneralRe: Ok, this is totally bizarre Pin
Marc Clifton9-Oct-19 6:25
mvaMarc Clifton9-Oct-19 6:25 
GeneralRe: Ok, this is totally bizarre Pin
TheGreatAndPowerfulOz9-Oct-19 11:38
MemberTheGreatAndPowerfulOz9-Oct-19 11:38 
GeneralRe: Ok, this is totally bizarre Pin
PeejayAdams9-Oct-19 6:35
MemberPeejayAdams9-Oct-19 6:35 
GeneralRe: Ok, this is totally bizarre Pin
Marc Clifton9-Oct-19 7:42
mvaMarc Clifton9-Oct-19 7:42 
GeneralRe: Ok, this is totally bizarre Pin
abmv9-Oct-19 7:44
professionalabmv9-Oct-19 7:44 
GeneralRe: Ok, this is totally bizarre Pin
Chris Losinger9-Oct-19 9:35
professionalChris Losinger9-Oct-19 9:35 
GeneralThought of the Day Pin
OriginalGriff9-Oct-19 5:44
mveOriginalGriff9-Oct-19 5:44 
GeneralRe: Thought of the Day Pin
jeron19-Oct-19 5:51
Memberjeron19-Oct-19 5:51 
GeneralRe: Thought of the Day Pin
PIEBALDconsult9-Oct-19 5:57
professionalPIEBALDconsult9-Oct-19 5:57 
GeneralRe: Thought of the Day Pin
PeejayAdams9-Oct-19 6:11
MemberPeejayAdams9-Oct-19 6:11 
GeneralRe: Thought of the Day Pin
OriginalGriff9-Oct-19 6:17
mveOriginalGriff9-Oct-19 6:17 
NewsRe: Thought of the Day Pin
lopatir9-Oct-19 6:18
Memberlopatir9-Oct-19 6:18 
GeneralRe: Thought of the Day Pin
Mike Hankey9-Oct-19 6:43
professionalMike Hankey9-Oct-19 6:43 
GeneralWhat's the use of a Recruiter if he decides on own!! Pin
super9-Oct-19 1:22
professionalsuper9-Oct-19 1:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.