ios - Charles Map Local not working for JSON data? -
I am trying to simulate a server using Charles, I came to know that Charles is "Map Local .. . ", Which allows me to respond to a client using locally stored files.
Select the list of Charles Sequences and select "Save Response ..." that are pointing to files that are right-clicked.
However, when I test this with my iOS app, I get the following error message:
Failed to retrieve the fields: error domain = AFNetworking erroMine code = - 1016 "Expected Content Type {(" Text / Jason "," App / Jason "," Text / Javascript ")}, found text / plain" I am not sending feedback with the correct header information. Is there a way to tell Charles that the response is JSON? One potential problem is that the archived files contain only JSON data and no title.
You
The map will give local only a text / plain content-type.
To do this, add a rewrite rule to Charles to change the content-type header in Charles. Tools & gt; Go to rewrite ... & gt; Add.
Add all the locations, which you map locally and then for the rules, add one that looks like the following:
I do not advise only adjusting my code for Charles because it tests your web services Defeats the point of if you can not repeat them exactly.
Comments
Post a Comment