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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:04:54+00:00 2026-05-22T17:04:54+00:00

how to add username and password in http request to call web service? I

  • 0

how to add username and password in http request to call web service? I have write REST web service and if user want to do request ,he neeed to request like this in terminal :
curl -u username:password http://localhost:8080/user/folder

httpclient.getCredentialsProvider().setCredentials(new AuthScope(null, -1),
                    new UsernamePasswordCredentials("kyaw", "password"));
get.setHeader("Authorization","Basic a31hdzpwYXNzd29yZA==");

I used either way to do in android but get exception :

05-20 07:13:30.900: DEBUG/AndroidRuntime(557): Shutting down VM
05-20 07:13:30.900: WARN/dalvikvm(557): threadid=1: thread exiting with uncaught exception (group=0x40015560)
05-20 07:13:30.972: ERROR/AndroidRuntime(557): FATAL EXCEPTION: main
05-20 07:13:30.972: ERROR/AndroidRuntime(557): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/com.test.put}: java.lang.RuntimeException: Binary XML file line #18: You must supply a layout_width attribute.
05-20 07:13:30.972: ERROR/AndroidRuntime(557):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
05-20 07:13:30.972: ERROR/AndroidRuntime(557):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)

How do i do?

  • 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-05-22T17:04:54+00:00Added an answer on May 22, 2026 at 5:04 pm

    The error is “You must supply a layout_width attribute” (copy pasted from your stack trace).

    The error is unrelated to the code you are showing. You are missing a layout_width="" attribute in one of your components XML declaration.

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

Sidebar

Related Questions

I am attempting to add BASIC authentication to my RESTful web-service. Currently I have
I want to add integration with a third-party service to a web application (developed
i have the following code. Twitter t1 = new Twitter(twitteruser,password); TwitterUser user = t1.User.Show(username);
I add a web reference to my wse 3.0 service in Visual Studio 2005
So this is my situation. I have to consume a third party web service
I trying to invoke a web service, which has an Basic HTTP Authentication. I
Whats is the python urllib equivallent of curl -u username:password status=abcd http://example.com/update.json I did
Using Your Ruby Gem(s) You will need to add /home/username/ruby/gems to the include path.
When I run Roles.GetRolesForUser(username) the roles are returned correctly, however if I add a
Add service reference to Amazon service fails, saying Could not load file or assembly

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.