Burp Suite User Forum

Create new post

Sending Request Montoya

Phil | Last updated: Jun 03, 2023 12:39PM UTC

I'm trying to send a request with the following code, but getting -1. What's wrong with this workflow? TIA! HttpRequestResponse ret = api.http().sendRequest(HttpRequest.httpRequestFromUrl("https://google.com")); api.logging().logToOutput(String.valueOf(ret.statusCode()));

Hannah, PortSwigger Agent | Last updated: Jun 05, 2023 03:46PM UTC

Hi Do you have connectivity to the endpoint that you are making your request to? If you send a request to "https://google.com" from Repeater, do you receive a valid response back? You can quickly generate a request to an endpoint by copying the URL into your clipboard, then in Repeater, right-clicking and using "Paste URL as request".

Phil | Last updated: Jun 07, 2023 12:29PM UTC

Thank you for stating the obvious. I did NOT have connectivity to the requested URL. I had my proxy settings enabled and had forgotten. The above code works just fine.

Hannah, PortSwigger Agent | Last updated: Jun 07, 2023 12:58PM UTC

Glad to hear that sorted it out for you! If there's anything else we can help with, then please let us know.

You must be an existing, logged-in customer to reply to a thread. Please email us for additional support.