zoukankan      html  css  js  c++  java
  • 顺丰 丰桥对接 订单路由查询 ruby rails

    def self.get_express_route_test
      url = 'http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService'
      xml = "<Request service='RouteService' lang='zh-CN'><Head>4545</Head><Body><RouteRequest tracking_type='1' method_type='1' tracking_number='444003077898'/></Body></Request>"
      keyword = 'dsadsa'
      md5_str = Digest::MD5.digest((xml + keyword).encode('utf-8'))
      verifyCode = Base64.strict_encode64(md5_str)
      uri = URI.parse(url)
      req = Net::HTTP::Post.new(uri.path,{'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8'})
      req.body = "xml=#{xml}&verifyCode=#{verifyCode}"
      req = Net::HTTP.new(uri.host,uri.port).start{|http| http.request(req)}
      Rails.logger.debug req.body
    end
    

      

  • 相关阅读:
    48. Rotate Image
    83. Remove Duplicates from Sorted List
    46. Permutations
    HTML5笔记
    18. 4Sum
    24. Swap Nodes in Pairs
    42. Trapping Rain Water
    Python modf() 函数
    Python min() 函数
    Python max() 函数
  • 原文地址:https://www.cnblogs.com/tomtang/p/9605834.html
Copyright © 2011-2022 走看看