HTTP plugin for making HTTP/HTTPS requests
Core v2.2.0
This plugin performs GET and POST requests with full support for: headers, parameters, authentication, redirects, proper URL encoding, and binary content.
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://org.webharvest/schema/2.1/core">
<def var="url">https://httpbin.org/get</def>
<def var="response">
<http url="${url}"/>
</def>
<file action="write" path="target/http_output.txt">
<get var="response"/>
</file>
</config>
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://org.webharvest/schema/2.1/core">
<http url="https://api.example.com/users" method="POST">
<http-header name="Content-Type">application/json</http-header>
<http-header name="Authorization">Bearer ${apiToken}</http-header>
<http-param name="data">{"name": "John", "age": 30}</http-param>
</http>
</config>
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://org.webharvest/schema/2.1/core">
<http url="http://example.com/image.jpg"/>
<file action="write" path="downloaded_image.jpg" type="binary">${http}</file>
</config>
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://org.webharvest/schema/2.1/core">
<!-- Color parameter #FF0000 is automatically encoded as %23FF0000 -->
<http url="http://example.com/api?color=#FF0000&size=large"/>
</config>