Best answer

Failed to create a http request in WordPress

  • 3 October 2023
  • 7 replies
  • 245 views

Userlevel 1

 

 

Please help me. I enter an api request (beta) in WP and it ends with the message Failed to create a http request in WordPress, Raw request failed.

 

If I change the url it works, but it's not correct. POST should be to the entire url https://katarinaruna.com/wp-json/mioweb/v1/add-membership

 

 

In postman it's OK, so I'm probably doing something wrong.

 

icon

Best answer by ishto 3 October 2023, 15:38

View original

7 replies

Userlevel 1

Hey Mirka!

First thing that I see is that in the Authorization section, you’re using base64_encode function which I believe it doesn’t work this way. Just encode it once yourself and put the output there.

Second, that Authorization is meant to be an additional one. If it is your primary authorization, just skip it. Zapier will include it automatically

Third, I don’t see your query strings included in the screenshot. Make sure you do.

If the issue still persists, feel free to DM me for a deeper look

Userlevel 1

Thanks for your answear.

  1. the authorization should then be like this The authorization should then be like this Basic bWlvd2ViOmJmTnhBaGh0UWpwT0tWbDBpTHJtakJUSA==

     

  2. It is an additional authorization for that specific post
  3. The parameters are defined


    I get an error when I define this entire address in the url post. If I use https://katarinaruna.com it's OK.

     

Userlevel 1

The base URL may return 200 at any situation which only means that the website is accessible for Zapier.  

Let’s do two things:

  1. On postman, get the code snippet of the request that successfully does the job you want, in Python. Check its “headers” parameter, and make sure you include those key values in your Zapier header as well.
  2. Post the error page of Zapier when the task fails. It should contain some info about the response of the endpoint that can help us diagnose the issue further

 

Userlevel 1

Hello,
my code snipet via postman is:
 


As a result, I found out that I won't do it via event api request (beta), because I probably need a webhook. Because it doesn't create curl for me in the api, or should I enter it somewhere? 

I found this https://community.zapier.com/code-webhooks-52/using-curl-or-change-format-to-send-api-request-6998

Userlevel 1

Yeah just make a simple Post request and it should work 

Userlevel 1

Hello, super, I registered via webhook and it opened the members' section. But when I went to make an order to make sure that I was going to test it in production, it didn't automatically work out for me. Is it because I don't have a premium zapier account?

Userlevel 1

Hello, thanks for your help, I solved it and have automated opening :-)

Reply