Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8932437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:19:10+00:00 2026-06-15T09:19:10+00:00

So I have this string URL for an HTTP request http://locahost:3000/stuff?owner=foo bar+type=video game I

  • 0

So I have this string URL for an HTTP request

http://locahost:3000/stuff?owner=foo bar+type=video game

I need to pass this as part of an HTTP get request to another ruby service. How do I encode this URL, i.e. take off the spaces and special characters and come up with the right request URL? Is there a gem to handle that.
I know this could probably be done with some kind of regex, but I was hoping to find a standard gem that could do this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:19:11+00:00Added an answer on June 15, 2026 at 9:19 am
    require 'uri'
    uri_string = URI::encode("http://localhost:3000/stuff?owner=foo bar+type=video game")
    

    Not sure how searching for “ruby url encode” or parsing etc. didn’t find that for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

request.url returns me this : http://localhost:3000/page?foo=bar . Is there a method I can call
I have this URL- http://localhost/app_demo/sample.php?jsonRequest={GenInfo:{type:Request,appname:XXX,appversion:1.0.0},searchDish:{userId:295,dishName:,est:Pizza &amp; Wings,location:,type:,priceRange:,deviceos:value,deviceId:<UDID>,deviceType:value,pageNo:1}} when I hit this URL and print
I have a url string like this: http://www.google.com/cse?cx=017840637368510444960:ny1lmky7r-0&client=google-csbe&output=xml_no_dtd&q=simon+g I need to send this url
I have a url of a type where query string is like this... ?
I have this mootools request: new Request({ url: 'http://localhost:8080/list', method: 'get', }).send(); and a
I have an url like this: http://www.w3schools.com/PHP/func_string_str_split.asp I want to split that url to
Hi have this URL string which I need to extract possibly using regex but
i have this class public class Image { public string url { get; set;
I have a YQL output JSON string at this URL: YQL JSON I found
i have a webservice that is returning this response : <string xmlns=http://tempuri.org/>{ Head:[ {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.