Skip to main content
  • 1,231 Posts
  • 4,356 Replies
1231 Posts
Why would Urllib.request.urlopen return b'' when running a webhook?

I am trying to run webhooks on FME Server. The webhooks run successfully and I get status code 200 from the server but when I check the length of the data in the response it is 0, in this case 0. Is there a header I am missing?from urllib.request import urlopenfrom shutil import copyfileobjdef runwebhook(runurl):    response = urlopen(runurl)    if response.getcode()==200:        print("Success")    return responsedef savefilestream(filepath,response):    if exists(filepath): remove(filepath)    if isinstance(response.read(),bytes)==True:        with open(filepath,'wb') as f:            data = len(response.read())            print(data)            copyfileobj(response, f)            f.close()            print("File Saved Successfully")    else:        with open(filepath,'w') as f:            f.write(str(response.read()))

Badge Winners

  • FME Form Advanced Training
    mike_greshhas earned the badge FME Form Advanced Training
  • FME Flow Authoring Training
    lolashas earned the badge FME Flow Authoring Training
  • Welcome Back
    nanothstinehas earned the badge Welcome Back
  • Teacher (Grey)
    lauryn00789has earned the badge Teacher (Grey)
  • Integrate Data with the FME Platform Training
    nwinghas earned the badge Integrate Data with the FME Platform Training
Show all badges

Community Stats

32,431
Posts
123,238
Replies
40,557
Members