How to delete User-Agent header field from http request ?

Hi,
I'm currently using HttpUrlConnection to create a HTTP 1.1 POST client, and I wish to remove the User-Agent field from my request.
However, java seems to set this field to "java.1.4.2" if none is provided.
I have found methods to modify the User-Agent ( "setRequestProperty()" and system property "http.agent" ) but none to delete it.
Is there a way to remove this header from the request ?
This field is said as "should be implemented" but is not required in rfc2616(http1.1), so I'm a bit surprised that I can't remove it in the java HttpUrlConnection...
Thank you for your help,
Gregoire

You can always go around java.net.HttpUrlConnection with your own subclass of UrlConnection or simply a socket. You may lose some functionality, for example with handling binary content, but it may still be a solution.
(But are you saying that the server requires that there's no user-agent header? That's not a case of incompatibility, it's a bug. Scrap the server, and get one that works.
It seems a lot more likely that the server just have strict ideas of what user agents it wants to talk to. Then instead of removing the header, you want to find out what values the server will expect.)

Similar Messages

  • How to transfer user defined accounting fields from SRM to ECC ?

    Hi!
    We are running SRM 5.0 and ECC 6.0 with classic scenario.
    We have defined Business entity filed account assignment tab in SRM SHC.
    New fields are also defined in tables BBP_C_ACC_F and in BBP_C_ACCFD and added in the structure also INCL_EEW_PD_ACC_CSF. New fields are also defined in srpo accounting.
    In R/3 the same field is already defined as it is standard one.
    When I create PR or PO i entered the Business entity for the account assignment R i.e real estate.
    However, when I order my shopping cart with values in new fields, the values are not transferred into backend.
    Standard fields transfer nicely, but the user defined fields dont transfer.
    Can any please let me know what we have to do for these user defined values to transfer to back end. We need to implement any BADI ?
    Please let me know
    Thanks

    Hi,
    Use  BADI  BBP_CREATE_PO_BACK ( t.code SE18) can transfer custom fields
    some useful links to transfer custom fields from SRM to ECC..
    Re: Purchase Order item customer fields
    implementation of BADI BBP_ECS_PO_OUT_BADI in SRM. and BBP_PO_INBOUND_BADI
    Re: Custom field values are not being transfered to the backend system
    Re: How to replicate SRM PO customer fields to ERP PO in ECS
    Update Custom Fields in PO - BBP_ECS_PO_OUT_BADI
    BBP_ECS_PO_OUT_BADI
    implementation of BADI BBP_ECS_PO_OUT_BADI in SRM. and BBP_PO_INBOUND_BADI
    Update Header Text in R/3 using BBP_ECS_PO_OUT_BADI
    Hope these are helpful..
    Thanks
    prasad .s

  • How can I get the "text" field from the actionEvent.getSource() ?

    I have some sample code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class JFrameTester{
         public static void main( String[] args ) {
              JFrame f = new JFrame("JFrame");
              f.setSize( 500, 500 );
              ArrayList < JButton > buttonsArr = new ArrayList < JButton > ();
              buttonsArr.add( new JButton( "first" ) );
              buttonsArr.add( new JButton( "second" ) );
              buttonsArr.add( new JButton( "third" ) );
              MyListener myListener = new MyListener();
              ( (JButton) buttonsArr.get( 0 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 1 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 2 ) ).addActionListener( myListener );
              JPanel panel = new JPanel();
              panel.add( buttonsArr.get( 0 ) );
              panel.add( buttonsArr.get( 1 ) );
              panel.add( buttonsArr.get( 2 ) );
              f.getContentPane().add( BorderLayout.CENTER, panel );
              f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              f.setVisible( true );
         public static class MyListener  implements ActionListener{
              public MyListener() {}
              public void actionPerformed( ActionEvent e ) {
                   System.out.println( "hi!! " + e.getSource() );
                   // I need to know a title of the button (which was clicked)...
    }The output of the code is something like this:
    hi! javax.swing.JButton[,140,5,60x25,alignmentX=0.0,alignmentY=0.5,
    border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1ebcda2d,
    flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,
    disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,
    right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,
    rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=first,defaultCapable=true]
    I need this: "first" (from this part: "text=first" of the output above).
    Does anyone know how can I get the "text" field from the e.getSource() ?

    System.out.println( "hi!! " + ( (JButton) e.getSource() ).getText() );I think the problem is solved..If your need is to know the text of the button, yes.
    In a real-world application, no.
    In a RW application, a typical need is merely to know the "logical role" of the button (i.e., the button that validates the form, regardless of whether its text is "OK" or "Save", "Go",...). Text tends to vary much more than the structure of the UI over time.
    In this case you can get the source's name (+getName()+), which will be the name that you've set to the button at UI construction time. Or you can compare the source for equality with either button ( +if evt.getSource()==okButton) {...}+ ).
    All in all, I think the best solution is: don't use the same ActionListener for more than one action (+i.e.+ don't add the same ActionListener to all your buttons, which leads to a big if-then-else series in your actionPerformed() ).
    Eventually, if you're listening to a single button's actions, whose text change over time (e.g. "pause"/"resume" in a VCR bar), I still think it's a bad idea to rely on the text of the button - instead, this text corresponds to a logical state (resp. playing/paused), it is more maintainable to base your logic on the state - which is more resilient to the evolutions of the UI (e.g. if you happen to use 2 toggle buttons instead of one single play/pause button).

  • How to delete a READ ONLY file from Directory

    Hi Friends,
    how to delete a READ ONLY file from Directory , file is in my system only.
    Please help me .
    note: its read only file.
    Thank you.
    Karthik.

    hI,
    try with this statement.
    delete dataset <datasetname>.
    this will definitely work.
    Regards,
    Nagaraj

  • I need to know how to delete downloaded videos and movies from iTunes when the instructions on the support page does not work.  I have swiped the selections from left to right on the phone and nothing happens.

    Hello.
    I need help deleting videos, tv shows, and movies downloaded from itunes.  I have followed the instructions to delete from the macbook, I selected the videos I wanted to delete and right clicked to delete.  Nothing happens.  When I double click on the video it still starts playing.  I also followed the instructions to delete the videos from the iphone by swiping from left to right with nothing happening.  I opened the videos on the ipad and there is no edit selection like in the instructions on the support page. Can you please tell me how to permanently remove this content so it doesn't try to copy from each device when I want to back up the Iphone and Ipad to my macbook.  Thank you.

    Hi Shawninglewood,
    Welcome to the Support Communities!
    The article below may be able to help you with this.
    How to delete content you've downloaded from the iTunes Store, App Store, iBooks Store, or Mac App Store
    http://support.apple.com/kb/HT5772
    Cheers,
    - Judy

  • How to delet the credit card details from apple id account

    how to delet the credit card details from apple id account

    On your computer's iTunes you should be able to edit your payment info by going into the Store > View Account menu option and logging into your account, and on your account's details page there should be a payment link.  If you are doing it on your phone then tap on your id in Settings > iTunes & App Store and tap on 'View Apple ID' on the popup and log into your account  - that should also give you a payments link on your account's page.
    Changing payment info : Change or remove your payment information from your iTunes Store account (Apple ID)
    If you don't get the 'none' option on the payment details screen : Why can’t I select None when I edit my Apple ID payment information?

  • How to delete the sales org information from BP Master Data in SAP CRM 5.0

    Hi Guruu2019s
    How to delete the sales org information from BP Master Data in SAP CRM 5.0
    Thanks...
    Mahesh Pasupunuri

    Hello
    There is a report attached to [SAP Note 725857|https://service.sap.com/sap/support/notes/725857] that performs the deletion.
    Regards
    Joaquin

  • Get a specific Http header field from an http request in a component

    Hello,
    In a custom component that I've created ( which extends ServiceHandler), I'd like to access a specific http header field from the http requests that this component receives.
    I assume this could be accessible through m_binder or m_service, but I didn't find any solution so far.
    Any Idea?
    Thanks in advance,
    Leo

    As it may help others, I answer what I figured out.
    Every details of the http request is put into the m_binder.
    So a specific field can be accessed with m_binder.getEnvironmentValue("My_data")
    You can also list all the available data as it is a standard properties set.

  • How to Set User-Agent in UIWebView?

    I tried to change User-Agent using NSMutableURLRequest in the UIWebView delegate function, but didn't work. The funny thing is...the User-Agent string changed if the request is redirect. Have anyone experienced it? I want to change User-Agent of every request from UIWebView to the same like coming from Safari browser. Please HELP!!

    I would try the Apple Developer Connection, this forum is for users of the iPhone, you aren't going to get much help with this.

  • Accessing Message Header fields from envelope

    I am doing an interface with the RNIF adapter. They want me to pull the delivery header information, which is in the RNIF envelope, not the payload document and map it into some fields that exist in the inbound schema. Can this be done in message mapping? I would suppose that this question would apply if one wanted message header fields from the SOAP envelope also.
    Kind Regards,
    Chris

    Have you checked this ?
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Regards,
    Amol

  • How can delete the serve.bannersdontwork virus from Safari on Mac?

    Hello @all,
    How can delete the serve.bannersdontwork virus from Safari on Mac?
    About every 8-20 clicks Safari opens a webside named serve.bannersdontwork.
    I can not remove this with my Avira antivirus programm.
    Can anybody help me?
    THX
    Hallo an alle,
    Ich habe mir einen Virus eingefangen, serve.bannersdontwork, auf Safari.
    Alle 8-20 clicks öffnet sich diese Seite "serve.bannersdontwork" und leitet mich auf andere weiter.
    Über mein Antivirusprogramm Avira konnte ich den Virus nicht beheben.
    Auch die erweiterung AdBlock hilf hier nicht weiter.
    Wer weiß, oder hat eine Ahnung, wie man diesen Virus wieder los wird?
    Danke schonmal im voraus!!

    From the Safari menu bar, select
    Safari ▹ Preferences ▹ Extensions
    Turn all extensions OFF and test. If the problem is resolved, turn extensions back ON and then disable them one or a few at a time until you find the culprit.
    If you wish, you may be able to salvage the errant extension by uninstalling and reinstalling it. Its settings will revert to their defaults. If the extension still causes a problem, remove it permanently or refer to its developer for support.

  • How to delete/remove the software component from integration repository

    Dear All
    How to delete/remove the software component from integration repository which we have created some Data and message types.
    Regards
    Blue

    Hi,
      Follow the steps below to delete the Software component:
    1. Delete the created Data Types, Message Types, Message Interfaces, Message Mappings, Interface Mappings and other imported objects like RFC's or IDoc's. Activate all changes.
    2. Then delete the namespace and the default datatypes present with the namespace after checking "objects are modifiable".
    3. Then delete the SW component, after placing the radio button in "Not permitted".
    Regds,
    Pinangshuk.

  • HT4623 how to delet photos that were downloaded from the computer

    How to delet photos that were downloaded from the computer?

    Resync the iPad with the computer, but before doing so, click on the device once it is hooked up to iTunes. You will see the Device Profile to the right with several tabs - Photos being one of them. Select the Photos tab, and either uncheck the Sync Photos box at the top (if you don't want any of the photos to be on your device), or uncheck the selected photos you no longer want to sync.
    Cheers,
    GB

  • How to delete/drop all the tables from SQL Server Database without using Enterprise Manager?

    How to delete/drop all the tables from SQL Server Database without using Enterprise Manager?
    I tried using DROP Tables, Truncate Database, Delete and many more but it is not working.  I want to delete all tables using Query Analyzer, i.e. through SQL Query.
    Please help me out in this concern.
    Nishith Shah

    Informative thread indeed. Wish I saw it early enough. Managed to come up with the code below before I saw this thread.
    declare @TTName Table
    (TableSchemaTableName
    varchar
    (500),
    [status] int
    default 0);
    with AvailableTables
    (TableSchemaTableName)
    as
    (select
    QUOTENAME(TABLE_SCHEMA)
    +
    +
    QUOTENAME(TABLE_NAME)
    from
    INFORMATION_SCHEMA.TABLES)
    insert into @TTName
    (TableSchemaTableName)
    select *
    from AvailableTables
    declare @TableSchemaTableName varchar
    (500)
    declare @sqlstatement nvarchar
    (1000)
    while 1=1
    begin
    set @sqlstatement
    =
    'DROP TABLE '
    + @TableSchemaTableName
    exec
    sp_executeSQL
    @sqlstatement
    print
    'Dropped Table : '
    + @TableSchemaTableName
    update @TTName
    set [status]
    = 1
    where TableSchemaTableName
    = @TableSchemaTableName
    if
    (select
    count([Status])
    from @TTName
    where [Status]
    = 0)
    = 0
    break
    end

  • How to delete master data of materials from sap tables

    how to delete master data of materials from sap tables...its needed now.
    i know its not recommended but still we need to do this. give me the best possible approach.
    regards,
    suneetha

    Hi,
    I would suggest you not to write your own code to delete the entries.
    BAPI_MATERIAL_DELETE, this would mark all materials selected for deletion. But still the material would exist in SAP.
    Another solution: Delete a material manually and in another session execute the transaction SM04. This would display the tables which get locked when you do the operation, Then you can write your own code to delete the material numbers from all the related tables.
    Regards
    Subramanian

Maybe you are looking for

  • How do I put the spacebar back on my Macbook Pro?

    Recently my spacebar was acting up, so I removed and cleaned it. Problem is, I don't know how to reattach the spacebar! Help would be greatly appreciated! Thanks!!

  • What is a boot disc

    My macbook goes to a black screen and says "N bootable device -- insert boot dick and press any key"  What is a boot disc

  • Skype doesn't appear after log in

    Hi, I'm experiencing a problem where whenever I sign in to skype, the log in screen appears, but then the main page doesn't. My computer still shows that Skype's open, but it won't appear whenever I click on it. I've tried shutting it down via Task M

  • Does anyone know where I can get a suitable armband for a Zen Tou

    Can onyone post a link or brandname/model?

  • 10.3.9 to 10.5.0

    I originally bought an iPod touch, and when I hooked it up to my computer it wasn't compatible or something. So I bought Leopard to upgrade my computer. When I put the disc in however, it said I didn't have enough RAM. I have currently: Version 10.3.