Python POST Requests | API example

Поделиться
HTML-код
  • Опубликовано: 9 ноя 2024

Комментарии • 20

  • @jarjarjar9006
    @jarjarjar9006 2 года назад +1

    this movie helps a lot! Thanks

    • @python360
      @python360  2 года назад

      Thanks JJJ, glad it helped 👍

  • @lordmelbury7174
    @lordmelbury7174 3 года назад +1

    Thank you for the video. Useful!!

  • @leeebbrell9
    @leeebbrell9 Год назад +1

    have you had any issues using the post request on a script running in background, i have a script which run fine in foregound, but locks up when performing the request call to the server

    • @python360
      @python360  Год назад

      No, are you using Win or Linux/Mac, are you using su?

  • @candrasniper3404
    @candrasniper3404 2 года назад +1

    Could you tell me about how to use certificate in requests.post when the web is using tls and ssl (verify=True)? What are kinda cert and key that we have to choose? I'm still facing SSL error issues.

    • @python360
      @python360  2 года назад

      Check this :
      You can pass verify the path to a CA_BUNDLE file or directory with certificates of trusted CAs:
      >>>requests.get('github.com', verify='/path/to/certfile')
      requests.get('kennethreitz.org', cert=('/path/client.cert', '/path/client.key'))
      Requests uses certificates from the package certifi. This allows for users to update their trusted certificates without changing the version of Requests.

  • @ketanmehta3058
    @ketanmehta3058 2 года назад +1

    How to print the post method json response? Response.json is throwing some error.

    • @python360
      @python360  2 года назад +1

      Can you share your code?

    • @ketanmehta3058
      @ketanmehta3058 2 года назад +1

      @@python360 may I get your mail id? Note: response.text is working fine and showing the resultant dataset having \u000d\u000a\ but response.json is throwing the exception.

    • @python360
      @python360  2 года назад +1

      yes, just use the 'business address' button on the Python360 RUclips channel page, it'll reach me.

    • @ketanmehta3058
      @ketanmehta3058 2 года назад +1

      @@python360 sent

    • @python360
      @python360  2 года назад +1

      @@ketanmehta3058 Just replied to you!

  • @MohAmuza
    @MohAmuza 2 года назад +1

    thx but how to access post request API with scrapy now

    • @python360
      @python360  2 года назад

      Send params as JSON, it's in the Scrapy documentation for POST

  • @mariusbotezatu6365
    @mariusbotezatu6365 3 года назад +1

    How can I send an xml file to an endpoint?

    • @python360
      @python360  3 года назад

      Can you elaborate a bit? What is the URL of the endpoint?

  • @BillusTinnus
    @BillusTinnus 2 года назад +1

    Piss? 4:03

    • @python360
      @python360  2 года назад +1

      Pi Software Solutions