Click here to Skip to main content
15,905,566 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 8:56
mvaraddevus9-Oct-19 8:56 
GeneralRe: Woman Sets Up A Fake Art Gallery In London — And Actually Sells Her Paintings Pin
PIEBALDconsult9-Oct-19 9:25
mvePIEBALDconsult9-Oct-19 9:25 
GeneralRe: Woman Sets Up A Fake Art Gallery In London — And Actually Sells Her Paintings Pin
Rajesh R Subramanian9-Oct-19 13:54
professionalRajesh R Subramanian9-Oct-19 13:54 
PraiseRe: Woman Sets Up A Fake Art Gallery In London — And Actually Sells Her Paintings Pin
PeejayAdams9-Oct-19 22:32
PeejayAdams9-Oct-19 22:32 
GeneralRe: Woman Sets Up A Fake Art Gallery In London — And Actually Sells Her Paintings Pin
Rajesh R Subramanian9-Oct-19 22:45
professionalRajesh R Subramanian9-Oct-19 22:45 
GeneralRe: Woman Sets Up A Fake Art Gallery In London — And Actually Sells Her Paintings Pin
Amarnath S9-Oct-19 16:59
professionalAmarnath S9-Oct-19 16:59 
GeneralRe: Woman Sets Up A Fake Art Gallery In London — And Actually Sells Her Paintings Pin
Ravi Bhavnani9-Oct-19 18:18
professionalRavi Bhavnani9-Oct-19 18:18 
GeneralOk, this is totally bizarre Pin
Marc Clifton9-Oct-19 4:57
mvaMarc Clifton9-Oct-19 4: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 4:59
mvePIEBALDconsult9-Oct-19 4:59 
GeneralRe: Ok, this is totally bizarre Pin
Marc Clifton9-Oct-19 5:02
mvaMarc Clifton9-Oct-19 5:02 
GeneralRe: Ok, this is totally bizarre Pin
Shameel9-Oct-19 5:19
professionalShameel9-Oct-19 5:19 
GeneralRe: Ok, this is totally bizarre Pin
Marc Clifton9-Oct-19 5:25
mvaMarc Clifton9-Oct-19 5:25 
GeneralRe: Ok, this is totally bizarre Pin
TheGreatAndPowerfulOz9-Oct-19 10:38
TheGreatAndPowerfulOz9-Oct-19 10:38 
GeneralRe: Ok, this is totally bizarre Pin
PeejayAdams9-Oct-19 5:35
PeejayAdams9-Oct-19 5:35 
GeneralRe: Ok, this is totally bizarre Pin
Marc Clifton9-Oct-19 6:42
mvaMarc Clifton9-Oct-19 6:42 
GeneralRe: Ok, this is totally bizarre Pin
abmv9-Oct-19 6:44
professionalabmv9-Oct-19 6:44 
GeneralRe: Ok, this is totally bizarre Pin
Chris Losinger9-Oct-19 8:35
professionalChris Losinger9-Oct-19 8:35 
GeneralThought of the Day Pin
OriginalGriff9-Oct-19 4:44
mveOriginalGriff9-Oct-19 4:44 
GeneralRe: Thought of the Day Pin
jeron19-Oct-19 4:51
jeron19-Oct-19 4:51 
GeneralRe: Thought of the Day Pin
PIEBALDconsult9-Oct-19 4:57
mvePIEBALDconsult9-Oct-19 4:57 
GeneralRe: Thought of the Day Pin
PeejayAdams9-Oct-19 5:11
PeejayAdams9-Oct-19 5:11 
GeneralRe: Thought of the Day Pin
OriginalGriff9-Oct-19 5:17
mveOriginalGriff9-Oct-19 5:17 
NewsRe: Thought of the Day Pin
lopatir9-Oct-19 5:18
lopatir9-Oct-19 5:18 
GeneralRe: Thought of the Day Pin
Mike Hankey9-Oct-19 5:43
mveMike Hankey9-Oct-19 5:43 
GeneralWhat's the use of a Recruiter if he decides on own!! PinPopular
super9-Oct-19 0:22
professionalsuper9-Oct-19 0: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.