Hi People,
Is there a person or a contact email address regarding formidable forms integration with API posts for Payfast?
The Issue:
Im testing a transaction with Postman and FF to Payfast in the SandBox, in FF I keep experiencing a 400 Bad request, but in Postman all is working 100% and get a 200 OK response.
I have verified headers, form urlencoding and also looking at FF logfiles and all looks good, but still im getting a 400 Bad Request from FF.
Is there someone that can assist me, or provide me a Email contact address whom knows how to further debug this issue?
Help is much appreciated
I think you have some confusion about HTTP protocols. The 1.0 vs. 2.0. vs. 3.0 is a web server function. It has nothing to do with WordPress or Formidable or any other software running on your web server. If your webserver is serving HTTP 1.0 TCP connections, you need to upgrade your web server.
Hi Victor, much appreciated for your input - if a webserver have only HTTP 1.0 installed, then I suggest leave that hosting company. (small humor)
Just a quick summary for my case,
It looks like when HTTP Requests are being used and if it is of version 1, it defaults to 1.0 and it ignores auto negation of the protocols of version 1. I had to go and force my WordPress to use 1.1 and then FF stated using 1.1. The API that I require to access, works on 1.1, developer's choice. The logfiles of FF do not show protocols - the headers and body/formdata was all 100%, so I was thumbling in the dark. Here is another point to ponder, I used WPGetAPI and all working firs time when I called the API - why?
Hope that gives more insights into my issue - apologies if I did not explain this properly.
To force WordPress to use HTTP/1.1, the request protocol version is not something WordPress directly controls—it's managed by the web server (Apache, Nginx, etc.) and the PHP HTTP client, such as wp_remote_get() or libraries like cURL or Requests.
Here's how a developer can influence HTTP/1.1 usage in various contexts:
1. Force HTTP/1.1 in wp_remote_get() or wp_remote_post()
WordPress uses the Requests library under the hood. You can pass a 'httpversion' parameter to force HTTP/1.1:
$response = wp_remote_get('http://example.com', [
'httpversion' => '1.1'
]);
This is useful when you're making outbound HTTP requests from a plugin or theme.
2. Force HTTP/1.1 in cURL
If you're using cURL directly (e.g., outside of WordPress or via wp_remote_request() with curl transport), you can do:
$ch = curl_init('http://example.com');
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_exec($ch);
curl_close($ch);
3. Web Server Configuration
If you're serving your WordPress site and want to ensure the server responds using HTTP/1.1, you’ll need to configure your web server:
Apache: HTTP protocol support depends on the version of Apache and modules like mod_http2. To disable HTTP/2 (and fallback to HTTP/1.1), you can remove or comment out Protocols h2 h2c http/1.1 and just use Protocols http/1.1 in your Apache config.
Nginx: HTTP/2 is enabled per listen directive:
listen 443 ssl http2; # This enables HTTP/2
Remove http2 to force HTTP/1.1:
listen 443 ssl;
Restart the server afterward.
4. Browser/Client Side
If your concern is how clients (like browsers) connect to the WordPress site, this is controlled by the client and server negotiation. You can't "force" a client to use HTTP/1.1 from WordPress, but you can configure the server not to offer HTTP/2 or HTTP/3, so clients fall back to 1.1.
This is good information!!!, I used the "httpversion", but will investigate my server setup. This will help me so much going forward and resolving my issues. Thanks Victor.
Please login or Register to submit your answer
Hi people, i have traced the issue to http/1.0 that is used by formidable forms, api. This protocol was last used in the 1990's - it is older than 25 years! Payfast uses http/1.1 or http/2 like many modern day software. Can the staff please assist me how to log and urgent request to have the API upgraded to communicate with version http/1.1.
Assistance would be greatly appreciated.
just an update - could this perhaps be the fault of WordPress?