powered by simpleCommunicator - 2.0.59     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / Form and WebRequest
2 сообщений из 2, страница 1 из 1
Form and WebRequest
    #38403768
vital_vital
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Добрый вечер!

Есть такая форма:

Код: html
1.
2.
<form action="https://rbkmoney.ru/acceptpurchase.aspx" class="rbkm-payment-form" method="post" target="_blank">
            <input class="bttn bttn-218" name="button" type="submit" value="Купить"> <input name="eshopId" type="hidden" value="2000005"> <input name="orderId" type="hidden" value="order ID 333777"> <input name="successUrl" type="hidden" value="http://rbkmoney.ru"> <input name="failUrl" type="hidden" value="http://rbkmoney.ru"> <input name="serviceName" type="hidden" value="T-shirt, black, M size"> <input name="recipientAmount" type="hidden" value="50"> <input name="recipientCurrency" type="hidden" value="RUR"> <input name="user_email" type="hidden" value="example@example.com"></form>



Необходимо перенести отправку этого запроса на сервер

Вот что я делаю:

Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
// Create a request using a URL that can receive a post. 
            var request = (HttpWebRequest)WebRequest.Create("https://rbkmoney.ru/acceptpurchase.aspx");
          
            // Set the Method property of the request to POST.
            request.Method = "POST";
            
            // Create POST data and convert it to a byte array.
            string postData = "eshopId=2000005&orderId=123&successUrl=http://rbkmoney.ru&failUrl=http://rbkmoney.ru&serviceName=123&recipientAmount=50&recipientCurrency=RUR&user_email=example@example.com";

            byte[] byteArray = Encoding.UTF8.GetBytes(postData);
            
            // Set the ContentType property of the WebRequest.
            request.ContentType = "application/x-www-form-urlencoded";
            
            // Set the ContentLength property of the WebRequest.
            request.ContentLength = byteArray.Length;

            // Get the request stream.
            Stream dataStream = request.GetRequestStream();
            
            // Write the data to the request stream.
            dataStream.Write(byteArray, 0, byteArray.Length);
            
            // Close the Stream object.
            dataStream.Close();
            
            // Get the response.
            WebResponse response = request.GetResponse();
            
            // Display the status.
            Response.Write(((HttpWebResponse)response).StatusDescription);
            
            // Get the stream containing content returned by the server.
            dataStream = response.GetResponseStream();
            
            // Open the stream using a StreamReader for easy access.
            StreamReader reader = new StreamReader(dataStream);
            
            // Read the content.
            string responseFromServer = reader.ReadToEnd();
            
            //Response.Redirect();
            
            // Display the content.
            Response.Write(responseFromServer);
            
            // Clean up the streams.
            reader.Close();
            
            dataStream.Close();
            
            response.Close();



Ответ открывается у меня на сервере, а мне нужно чтобы он открывался на rbk. Подскажите, пожалуйста, что я не так делаю.
...
Рейтинг: 0 / 0
Form and WebRequest
    #38403771
Фотография hVostt
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
vital_vital,

нельзя
...
Рейтинг: 0 / 0
2 сообщений из 2, страница 1 из 1
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / Form and WebRequest
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]