Code Monkey home page Code Monkey logo

Comments (4)

hemantsharma-io avatar hemantsharma-io commented on August 17, 2024

There is no documentation on what variables there are. Please add it somewhere. How am I supposed to get the body of the request in the same format that fiddler show it when I drag a session to the Composer tab?

@stackedUI you didn't mention what are you trying to achieve by getting a Composer like request body.

MockingBird is an extension and like any other extension it extends existing functionality. This method shows how to get the request body as HTML encoded string. Each selected session in this extension inherits from Fiddler.Session class, which means you can use all the properties exposed by this class. e.g. this default template example is looping through all the RequestHeaders of session class instance.

In addition to above, please note that the request body is a binary data and the consumer of this data would need to decide how to parse it either by knowing what exactly the content type will be or having a switch case on request header's content type.

Documenting Fiddler classes is beyond the scope of this extension and you can explore https://www.telerik.com/fiddler for more details. You can look at Telerik FiddlerScript Editor to find out all the properties each object has

from mockingbird.

stackedUI avatar stackedUI commented on August 17, 2024

I would like to have the body in a format where I could copy it directly to something like curl and make a request with. I also would like it to be human-readable unlike something like RequestBodyAsHTMLEncode. I know there is an export to curl function but I would like to use it for other things as well so I need this functionality.

from mockingbird.

hemantsharma-io avatar hemantsharma-io commented on August 17, 2024

I would like to have the body in a format where I could copy it directly to something like curl and make a request with. I also would like it to be human-readable unlike something like RequestBodyAsHTMLEncode. I know there is an export to curl function but I would like to use it for other things as well so I need this functionality.

The Session object has a method GetResponseBodyAsString or GetRequestBodyAsString which can be used like below:

{{#SelectedSessions}}
   {{{GetRequestBodyAsString}}}
{{/SelectedSessions}}

Note that i've used {{{ }}} (i.e. 3 braces) to get request body without HTML encoding. if I use {{GetRequestBodyAsString}} i.e. 2 braces then the value will be by default HTML Encoded.

if you are interested in more properties and method then you can go to Fiddler > Rules > Customize Rules which should open the Fiddler Script editor and on right side you can see the session object with all the possible properties and methods that you can use:
image

image

from mockingbird.

hemantsharma-io avatar hemantsharma-io commented on August 17, 2024

i've also added a most used variables section to the wiki
https://github.com/hemantsharma-io/MockingBird#most-used-variables

from mockingbird.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.