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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:03:55+00:00 2026-06-04T20:03:55+00:00

i found that the result $request.ContentType is difference by using char[] and String. $request

  • 0

i found that the result $request.ContentType is difference by using char[] and String.

$request = [System.Net.HttpWebRequest].create($URL)

$request.ContentType = [char[]] "application/x-www-url-formurlened"
$request.ContentType = "application/x-www-url-formurlened"

What is the different in the actual output to the server side, if I made a request like that using char[] and string?

it is so confusing…i guess it should be the same

thanks

  • 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-04T20:03:57+00:00Added an answer on June 4, 2026 at 8:03 pm

    I think I figured out the issue. Check this out:

    PS D:\> $foo = "bar"
    PS D:\> $foo
    bar
    PS D:\> $faz = [string][char[]]"baz"
    PS D:\> $faz
    b a z
    

    Powershell will cast your char[] into a string, since HttpRequest.ContentType is of type string, but for when Powershell converts arrays to strings it inserts a the value of the special variable $OFS between each element. The help for about_special_variables has information on $OFS (and other things). The default for $OFS is a space which explains this behavior.

    (Thanks to BartekB for pointing out $OFS in the comments.)

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

Sidebar

Related Questions

I found that some result of MBRContains(g1,g2) and other functions seems not right to
I found that when group by multiple values does not work well with VB.NET,
I found that the owner:group of the files under /mnt/sdcard is always system:sdcard_rw. Even
I found that Asp.net Mvc controller can serve both Asp.net Mvc View and Silverlight
Scenario: A POST request is sent to process an order that will result in
I am using the Redirect After Post pattern in my ASP.NET MVC application. I
I wanted to develop a VB.NET application that uses google search and get the
I've tried searching around and I have found plenty of results that seem like
I found that IE 9 does not have this support while chrome,safari do have
I found that originalPayload does not do the same as message.originalPayload in groovy expressions.

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.