Support Center

Burp Community

See what our users are saying about Burp Suite:

How do I?

New Post View All

Feature Requests

New Post View All

Burp Extensions

New Post View All

Bug Reports

New Post View All

Burp Suite Documentation

Take a look at our Documentation section for full details about every Burp Suite tool, function and configuration option.

Full Documentation Contents Burp Projects
Suite Functions Burp Tools
Options Using Burp Suite

Burp Extender

Burp Extender lets you extend the functionality of Burp Suite in numerous ways.

Extensions can be written in Java, Python or Ruby.

API documentation Writing your first Burp Suite extension
Sample extensions View community discussions about Extensibility
Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

[python] adding a custom header and send JSON in post request.

reconnect Sep 17, 2017 07:28PM UTC

Hello team

I wanted to know how to add custom header and send JSON in post request in jython.

here is my basic code

def sendRequest(self,data):
body=self._helpers.buildParameter("body", encode, IParameter.PARAM_BODY);
print self._helpers.bytesToString(resp)

Paul Johnston Sep 18, 2017 02:19PM UTC Support Center agent

There’s a few approaches; the code below is one way:

from import URL
from burp import IBurpExtender

class BurpExtender(IBurpExtender):
def registerExtenderCallbacks(self, callbacks):
self.callbacks = callbacks
self._helpers = callbacks.getHelpers()

headers = [ ‘POST /q6v4xrq6 HTTP/1.1’, ‘Host:’, ‘Content-type: application/json’, ] body = ‘{"test": "ok"}’ req = self._helpers.buildHttpMessage(headers, body) resp = self.callbacks.makeHttpRequest(“”, 443, True, req) print self._helpers.bytesToString(resp)

Post Your public answer

Your name
Your email address