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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:57:28+00:00 2026-06-02T07:57:28+00:00

I want to post this form from server side (ASP.NET/C#): <FORM action=https://login:password@payment.architrade.com/cgi-adm/refund.cgi method=POST> <input

  • 0

I want to post this form from server side (ASP.NET/C#):

<FORM action="https://login:password@payment.architrade.com/cgi-adm/refund.cgi" method=POST>
    <input type="hidden" name="merchant" value="12345678">
    <input type="hidden" name="transact" value="11111111">
    <input type="hidden" name="amount" value="2000">
    <input type="hidden" name="currency" value="208">
    <input type="hidden" name="orderid" value="11223344">
    <input type="hidden" name="md5key" value="cfcd208495d565ef66e7dff9f98764da">
    <input type="hidden" name="textreply" value="yes">
</FORM>

I’m trying to use WebClient.UploadValues. My code is

 private void PostRefundRequest(Mediachase.Commerce.Orders.Payment payment)
    {
        WebClient webClient = new WebClient();
        NameValueCollection refundRequest = new NameValueCollection();
        PaymentMethodDto dibs = PaymentManager.GetPaymentMethodBySystemName("DIBS", SiteContext.Current.LanguageName);
        string merchant = GetParameterByName(dibs, DIBSPaymentGateway.UserParameter).Value;
        PurchaseOrder po = payment.Parent.Parent as PurchaseOrder;
        string orderid = po.TrackingNumber;
        string transact = payment.TransactionID;
        string amount = (payment.Amount * 100).ToString();
        refundRequest.Add("merchant", merchant);
        refundRequest.Add("transact", transact);
        refundRequest.Add("amount", amount );

        refundRequest.Add("currency", payment.Parent.Parent.BillingCurrency);
        refundRequest.Add("orderid", orderid);
        string md5 = GetMD5KeyRefund(merchant, orderid, transact, amount);
        refundRequest.Add("md5key", md5);
        refundRequest.Add("textreply", "yes");
        byte[] responseArray = webClient.UploadValues("https://<mylogin>:<mypassword>@payment.architrade.com/cgi-adm/refund.cgi", refundRequest);
    }

I tried to debug, and everything seems to be correct, but the API returns HTTP 401 (Unauthorized). My concern is: does WebClient.UploadValues support the url of the API (which includes username/password)

Thank you.

  • 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-02T07:57:30+00:00Added an answer on June 2, 2026 at 7:57 am

    You got to have Post in method parameter for UploadValues :

    NameValueCollection data = new NameValueCollection();
    data["input-data1"] = "value1";
    data["input-data2"] = "value2";
    data["input-data3"] = "value3";
    
    WebClient webClient = new WebClient();
    webClient.Credentials = new NetworkCredential(mylogin, mypassword);
    byte[] responseBytes = webClient.UploadValues("http://www.example.com/posttome.aspx", "POST", data);
    string response = Encoding.UTF8.GetString(responseBytes);
    

    Update: Maybe this is not enough, because in documentation is stated that POST is default for http scheme (http://msdn.microsoft.com/en-us/library/9w7b4fz7.aspx) I presume that is the same for https

    Update 2: Microsoft disabled that authentication in URL for internet explorer (http://support.microsoft.com/kb/834489) for security reasons, so probably that is disabled for web client to

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

Sidebar

Related Questions

I want to make a form like this, and i want to post the
I want to refer to this post, because it might relate: Make Form Fields
I know there is this post , but I still want to know more
I want to use this function: http://www.frankmacdonald.co.uk/php/post-to-wordpress-with-php.html Its used to post to Wordpress using
This is my first post in stackoverflow. I want to improve its google pagerank
Is this valid: $_SESSION['pictures']['rateAlbum']['_POST'] = $_POST; I want to save all of the POST
Hi I want to publsh a post on user's wall but am getting this
I want to make the time of each post to change in realTime. This
I already seen some question from here (stackoverflow) and THIS post, but I still
i have a jquery ajax form. i have validation at server side for repeated

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.