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 8904611
In Process

The Archive Base Latest Questions

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

How to use httpc:request if the URL is a Unicode string? get_songs(Findstring) -> application:start(inets),

  • 0

How to use httpc:request if the URL is a Unicode string?

get_songs(Findstring) ->
application:start(inets),
application:start(crypto),
application:start(public_key),
application:start(ssl),       
Uf = normalize(Findstring),
Ufs = unicode:characters_to_list(Uf),
Token= "e...2",
Req1="https://api.vk.com/method/audio.search?q="++Ufs++"&access_token="++Token,
case httpc:request(get, {Req1,[]}, [], []) of
{ok, {{_Version, 200, _ReasonPhrase}, _Headers, Body}} ->
    Result = io_lib:format("~ts",[Body]),
    Result;
Resp ->
    Result = io_lib:format("response: ~p ~n", [Resp]),
    Result   
end.

If I send Findstring as Latin1, the code working correctly. But if Findstring is in Unicode, I get an error.

crasher:
initial call: httpc_handler:init/1
pid: <0.172.0>
registered_name: []
exception error: bad argument
in function iolist_to_binary/1
called as iolist_to_binary([“GET”,” “,
[47,109,101,116,104,111,100,47,97,117,
100,105,111,46,115,101,97,114,99,104,63,
1083,1086,1083,38,97,99,99,101,115,115,
95,116,111,107,101,110,61,101,50,102,50,
98,55,53,100,101,50,101,101,52,55,51,48,
101,50,101,101,52,55,51,48,97,51,101,50,
100,102,102,55,54,57,101,101,50,101,102,
101,50,101,49,48,53,48,101,98,50,53,97,
101,50,49,51,50,98,98,55,98,100,56,57,
101,99,55,56,53,101,99,50],
” “,”HTTP/1.1″,”\r\n”,
“te: \r\nhost: api.vk.com\r\nconnection: keep-alive\r\n”,
“\r\n”,[]])

  • 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-15T02:10:41+00:00Added an answer on June 15, 2026 at 2:10 am

    You have to urlencode the query string parameters,,,

    It might seem strange that Erlang HTTP(S) modules do not contain that a useful routine, but may be related to module arrangement (I’m not an Erlang guru)

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

Sidebar

Related Questions

I have a url with several parameters is use for a http request. It
When I use the request URL as http://myapp.appspot.com quota use increases only for Quota
So I use apache HttpComponents to handle http request in java. Now I want
I'm trying to use a java.net.HttpURLConnection to make an HTTP request to a server.
basically what i want is redirect al request to use HTTPS instead of http
For the normal ajax request I use: strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' But this don't work
I am using Spring MVC's charset filter. This is the URL that I use
I'm needing to use an HTTP request from an iPhone to a PHP script
I need to make certain requests in my web application use the https connector.Suppose
I am very new to PHP, and need to use an HTTP Request to

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.