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

  • Home
  • SEARCH
  • 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 8168049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:23:41+00:00 2026-06-06T20:23:41+00:00

I am doing a cross domain post in .net, but in net they have

  • 0

I am doing a cross domain post in .net, but in net they have provided me with php example….i would like to convert the php code to .net. Please help.

 <?php
        header('Content-type: text/html');
        header('Access-Control-Allow-Origin: *');
        $uri = 'http'. ($_SERVER['HTTPS'] ? 's' : null) .'://'. $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
        echo('<p>This information has come from <a href="' . $uri . '">' . $uri . '</a></p>');
    ?>
  • 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-06T20:23:43+00:00Added an answer on June 6, 2026 at 8:23 pm

    Try something like this:-

    System.Net.WebRequest request = base.GetWebRequest(uri);         
    request.Headers.Add("Content-type", "text/html");
    request.Headers.Add("Access-Control-Allow-Origin", "*");
    

    $_SERVER is equivalent to Request.ServerVariables[]

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

Sidebar

Related Questions

I am doing a cross-domain fetch from a ASP.NET page using Jquery-JSONP My ASP.NET
I'm making a cross-domain POST request and have set up headers in Rails 3.2
I am trying to post a cross-domain HTTP request but keep getting a SecurityException
I'm doing some fairly simple cross-platform TCP socket programming. I have unfortunately found out
I am doing a cross domain request using $.ajax . It works on Firefox
I have used ajax with jquery 1.4.2 on my domain, but I need to
I'm trying to convert my code to Mootools (I like the coding paradigm better).
As you know doing Cross Domain XMLHTTP requests is not allowed for security reasons
I Have to do a cross-domain request and fetch content from a url using
Okay I'm doing a simple post like WebClient webClient = new WebClient(); webClient.Headers[content-type] =

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.