diff --git a/lib/codegen/ruby/net_http.dart b/lib/codegen/ruby/net_http.dart index d17c0a41..769fa273 100644 --- a/lib/codegen/ruby/net_http.dart +++ b/lib/codegen/ruby/net_http.dart @@ -7,7 +7,7 @@ import 'package:apidash/consts.dart'; class RubyNetHttpCodeGen { String kTemplateStart = """require "uri" require "net/http" -{% if type == "application/json" %}require "json"{% endif %} + url = URI("{{url}}") https = Net::HTTP.new(url.host, url.port) {% if check == "https" %}https.use_ssl = true{% endif %} @@ -22,12 +22,10 @@ request = Net::HTTP::{{method}}.new(url) String kTemplateBody = """ -request.body = JSON.dump({{body}}) -"""; +request.body = <