ruby rest-client: make it never timeout?

后端 未结 6 1275
温柔的废话
温柔的废话 2021-02-12 21:34

I am trying to use ruby rest-client to upload a large number of images to a site that I\'m writing. My code looks like:

RestClient.post url, :timeout => 9000         


        
6条回答
  •  灰色年华
    2021-02-12 22:15

    I have used following code and works like a charm as pointed out by Richard

    resource = RestClient::Resource.new "url", 
                                        :timeout => $TIMEOUT, 
                                        :open_timeout => $OPEN_TIMEOUT
    
    response = resource.get  :params => { ..... }
    

提交回复
热议问题