Python Forum
appending variabl a URL for requests.post step
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
appending variabl a URL for requests.post step
#3
Note the error it says it's trying to connect to the host (posturl), which doesn't exist.

If you want to expand the variable posturl in another string, you don't use parenthesis. You could use an f-string and curly braces like:

r = requessts.post(f"https://{posturl}")
Reply


Messages In This Thread
RE: appending variabl a URL for requests.post step - by bowlofred - Sep-04-2020, 06:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can't log in with requests post LilDog 2 6,138 Mar-11-2019, 08:16 AM
Last Post: yourv3nom
  Step -1 Upandon 2 3,089 Feb-27-2018, 06:02 AM
Last Post: Upandon
  No route to host error when using requests.post in python on raspberry pi mariummalik22 0 4,104 Jan-06-2018, 08:34 PM
Last Post: mariummalik22

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020