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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:09:14+00:00 2026-06-10T13:09:14+00:00

I am trying to access a REST web service but get an error HTTP

  • 0

I am trying to access a REST web service but get an error HTTP 500. There must be something I am not doing correct but couldn’t find out. It is a publicly available service, otherwise I would have gotten a 403 error.

Here is my code:
(url is a string containing the web service URL, param is a string containing the parameters.)

        string url = @"http://crimemapping.edmontonpolice.ca/DataProvider.asmx/getOccurrenceInfo";
        string param = "{\"method\":\"send\",\"params\":[\"neighbourhoodID\":\"2\",\"crimeTypes\":\"Assault\",\"strStartDate\":\"2011,12,02\",\"strEndDate\":\"2012,03,01\"]}";
        // Reassigning param to increase readability.
        param = @"{""method"":""send"",""params"":[""neighbourhoodID"":""2"",""crimeTypes"":""Assault;Sexual Assaults;Break and Enter;Theft From Vehicle;Homicide;Theft Of Vehicle;Robbery;Theft Over $5000"",""strStartDate"":""2012,02,01"",""strEndDate"":""2012,03,01""]}";

        string response;
        WebRequest request = WebRequest.Create(url);
        request.Method = "POST"; //REST based-services using Post method
        request.ContentType = "application/json"; //tells request the content typs is JSON
        request.ContentLength = param.Length;

        StreamWriter requestWriter = new StreamWriter(request.GetRequestStream(), System.Text.Encoding.ASCII);
        requestWriter.Write(param);
        requestWriter.Close();

        StreamReader responseReader = new StreamReader(request.GetResponse().GetResponseStream());
        response = responseReader.ReadToEnd();
        responseReader.Close();
  • 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-10T13:09:15+00:00Added an answer on June 10, 2026 at 1:09 pm

    What I couldn’t figure out in the beginning was that the JSON request cannot be made by any IP. It checks the IP before proceeding. The error I was getting was way off, so didn’t help much.

    Thanks all.

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

Sidebar

Related Questions

I am trying to access a REST web service using HTTP GET request. For
I'm trying to access rest service using ajax. If I'll paste this link on
I'm trying to use HTTPWebRequest to access a REST service, and am having problems
I've been trying to do some research on REST and SOAP web service supporting
I have a java REST service which works fine, I'm trying to access to
I am trying access a REST API. I can get it working in Curl/REST
I'm trying to access the REST Disqus API using the following url: http://disqus.com/api/3.0/threads/listPosts.json ?api_key=myKey
im trying to access a php rest service on a different server with silverlight,
Getting an error while trying to consume a Restful web service using POST method(with
I'm currently trying to access a REST API for the first time using visual

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.