zdennis (owner)

Revisions

gist: 178129 Download_button fork
public
Public Clone URL: git://gist.github.com/178129.git
Embed All Files: show embed
code_that_makes_request.rb #
1
2
3
4
5
6
7
url = "http://localhost:8000/spackle1/api/studentprojects/d0d84e45657d4841b504db75a196d708/tasks/6999dc92dee6485980a59c8b9c74e4e7/submissions/"
body = {
 :url => "http://test/url",
 :content => "description test ABC123"
}
a = Net::HTTP.post_form URI.parse(url), :request => body.to_json, :headers => { "Content-Type" => "application/json" }
 
request.txt #
1
2
3
4
5
6
7
POST /spackle1/api/studentprojects/d0d84e45657d4841b504db75a196d708/tasks/6999dc92dee6485980a59c8b9c74e4e7/submissions/ HTTP/1.1
Accept: */*
Content-Type: application/x-www-form-urlencoded
Content-Length: 155
Host: localhost:8000
 
headers=Content-Typeapplication%2fjson&request=%7b%22content%22%3a%22description%20test%20ABC123%22%2c%22url%22%3a%22http%3a%5c%2f%5c%2ftest%5c%2furl%22%7d