Skip to main content
Solved

HTTPcaller: Number of redirects hit maximum, Pythoncaller url request does work

  • June 14, 2019
  • 2 replies
  • 110 views

bartm
Contributor
Forum|alt.badge.img

I want to collect the _response_body of a certain website ( for example https://www.odnzkg.nl/mozard/!suite86.scherm0325?mPag=636 ). Normally the HTTPcaller or HTML tabel in a FeatureReader does the trick. However, by trying this on the url posted above it returns

 

HTTPCaller(HTTPFactory): HTTP/FTP transfer error: 'Number of redirects hit maximum amount'
HTTPCaller(HTTPFactory): Please ensure that your network connection is properly set up
HTTPCaller(HTTPFactory): No proxy settings have been entered.  If you require a proxy to access external URLs, please ensure the appropriate information has been entered

 

I already tried it at different networks to check if it is a proxy error. When I try to retrieve the HTML code using a PythonCaller it returns the required response_body

 

import fme
import fmeobjects
import requests as req
# Template Function interface:
# When using this function, make sure its name is set as the value of
# the 'Class or Function to Process Features' transformer parameter
def processFeature(feature):
    url = 'https://www.odnzkg.nl/mozard/!suite86.scherm0325?mPag=636'
    resp = req.get(url)
    print('Response_body: ' + resp.text)
    
    feature.setAttribute("httpBody", resp.text)
    
    
    pass 

Does somebody know the reason that it works via Python? Does it have something to do with the way the url request is formulated?

 

Thanks in advance,

Bart

Best answer by david_r

In the HTTPCaller, look under "HTTP Client options" and enable the option to save cookies:

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • Best Answer
  • June 14, 2019

In the HTTPCaller, look under "HTTP Client options" and enable the option to save cookies:

 


bartm
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • June 14, 2019

In the HTTPCaller, look under "HTTP Client options" and enable the option to save cookies:

 

Thanks for your quick response, that did the trick!