How can I run this curl command in Ruby?

Tyler Horan
curl --request PROPFIND --url "http://carddav.mail.aol.com/home/[email protected]/Contacts/" --header "Content-Type: text/xml" --header "Depth: 1" --data '<A:propfind xmlns:A="DAV:"><A:prop><A:getetag /><D:address-data xmlns:D="urn:ietf:params:xml:ns:carddav"/></A:prop></A:propfind>' --header "Authorization: Bearer fjskdlfjds"

Is there a particular method in Net::HTTP that allows the propfind command?

B Seven
Net::HTTP::Propfind

Here is an example:

uri = URI.parse('http://example.com')
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Propfind.new(uri.request_uri)

# Set your body (data)
request.body = "Here's the body."

# Set your headers: one header per line.
request["Content-Type"] = "application/json"

response = http.request(request)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can i run this curl command via command line interface

From Dev

How can I run a ruby file in command line from Java?

From Dev

How can I run the equivalent “curl” command that performs similarly to this “wget” command?

From Dev

How can I run a command line command from within a ruby file?

From Dev

How can I recreate this curl command in php?

From Dev

How can I transform this curl command into php curl code?

From Dev

How i can run Ghost Script command

From Dev

How can I run a command after boot?

From Dev

How can I run a command at login?

From Dev

How can I run this command succesfully

From Dev

cURL for Windows: how can I send multiple line command in a console?

From Dev

With curl, how can I pass multiple command line parameters in a POST?

From Dev

I can run curl from command line but can't call from shell exec

From Dev

How can I automatically run a command when I log out?

From Dev

How can I tell if I have permission to run a particular command?

From Dev

How can I automatically run a command when I log out?

From Dev

How can I run a Ruby gem from the shell?

From Dev

How can I refactor this Ruby method to run faster?

From Dev

How to run this curl command using Net:HTTP

From Dev

How can I use environment variables in a docker run command?

From Dev

How can I run a command and copy its output?

From Dev

How can I create a custom terminal command (to run a script)?

From Java

How can I run a command whenever a new buffer is opened?

From Dev

How can I run XCTest for a swift application from the command line?

From Dev

how can I open a extra console and run a program in it with one command?

From Dev

How can I run a command with grunt-shell with elevated privileges?

From Dev

How can I check for which command is run in setup.py?

From Dev

How can I run a simple text to speech command?

From Dev

How can I run a Windows command and return true everytime?

Related Related

  1. 1

    How can i run this curl command via command line interface

  2. 2

    How can I run a ruby file in command line from Java?

  3. 3

    How can I run the equivalent “curl” command that performs similarly to this “wget” command?

  4. 4

    How can I run a command line command from within a ruby file?

  5. 5

    How can I recreate this curl command in php?

  6. 6

    How can I transform this curl command into php curl code?

  7. 7

    How i can run Ghost Script command

  8. 8

    How can I run a command after boot?

  9. 9

    How can I run a command at login?

  10. 10

    How can I run this command succesfully

  11. 11

    cURL for Windows: how can I send multiple line command in a console?

  12. 12

    With curl, how can I pass multiple command line parameters in a POST?

  13. 13

    I can run curl from command line but can't call from shell exec

  14. 14

    How can I automatically run a command when I log out?

  15. 15

    How can I tell if I have permission to run a particular command?

  16. 16

    How can I automatically run a command when I log out?

  17. 17

    How can I run a Ruby gem from the shell?

  18. 18

    How can I refactor this Ruby method to run faster?

  19. 19

    How to run this curl command using Net:HTTP

  20. 20

    How can I use environment variables in a docker run command?

  21. 21

    How can I run a command and copy its output?

  22. 22

    How can I create a custom terminal command (to run a script)?

  23. 23

    How can I run a command whenever a new buffer is opened?

  24. 24

    How can I run XCTest for a swift application from the command line?

  25. 25

    how can I open a extra console and run a program in it with one command?

  26. 26

    How can I run a command with grunt-shell with elevated privileges?

  27. 27

    How can I check for which command is run in setup.py?

  28. 28

    How can I run a simple text to speech command?

  29. 29

    How can I run a Windows command and return true everytime?

HotTag

Archive