RichMail HttpBinaryGet gets a 404 Not Found for some urls

RichMail HttpBinaryGet gets a 404 Not Found for some urls

  

Hi guys,


don't know if you use RichMail that often, but we are using at least the HttpBinaryGet action to get the Binary of a picture by giving an URL.

So, what's happening is that for some URLs, this action is returning the message: 

"The remote server returned an error: (404) Not Found."

Yet, if I pick the URL and use it directly in my browser, or even in any front-end server's browser, I can see the picture.

Here's a URL example: "https://d2ojpxxtu63wzl.cloudfront.net/static/24a94" You can open it and see the picture.

Do you guys have any idea on what it can be? You can also suggest other ways to get the binary like this one does. I'm all open-mind on this ;)


Thank you,

Nelson Freitas


Hi Nelson,

Have you tried the method PostRequest_Submit of the HTTPRequestHandler extension? I think it will solve your problem.

Other alternative should be creating a rest service to retrieve that binary but i think the above suggestion will work.

Let me know if it worked.


Cheers,

Henrique

Hi Henrique,


thank you for your answer. I have tried the PostRequest_Submit action, and got following error:

"The remote server returned an error: (403) Forbidden."

So, it still didn't worked.


Best regards,

Nelson Freitas

Nelson Freitas wrote:

Hi Henrique,


thank you for your answer. I have tried the PostRequest_Submit action, and got following error:

"The remote server returned an error: (403) Forbidden."

So, it still didn't worked.


Best regards,

Nelson Freitas

Hi Nelson,

After analyzing the request, the browser is also returning a 404. See the below image:


I was able to return the binary, but i would NOT recommend this approach. Either-way I did the following:

  • Consume rest api
  • New OnAfterResponse
  • Assigning the response status code from 404 to 200.

This will return the image binary but changing the response status code isn't really an option.

Hope it helps.


Cheers,

Henrique

Hi Henrique,

thanks for the help, but, just like you said, its not recommended to use that approach. Need to get another solution.


Thanks,

Nelson Freitas

Nelson Freitas wrote:

Hi Henrique,

thanks for the help, but, just like you said, its not recommended to use that approach. Need to get another solution.


Thanks,

Nelson Freitas

No problem, happy to help.

But looking at it, can't really tell if there's a proper solution assuming that the end server will continue responding with 404.

Let me know if you find a different solution.


Cheers,

Henrique