I’m creating a post to send to a RESTful web service, my current code looks as such:
vReq = Net::HTTP::Post.new(uri.path)
vReq.body = postData
vReq.basic_auth('user', 'pass')
@printReq = vReq['basic_auth']
I am finding that the @printReq does not get assigned anything, and the headers, is not defined. Attempting to read any known header by name returns no results. It appears no header information is getting created when I do this. vReq.body does in fact return the postData I’ve created. What am I missing that will create the headers correctly?
You might want to try something like this: